Query Performance Investigation - Query ID -2757719728699534300 (pg_attribute and pg_collation tables)
Description
This query is listed as a top 50 queries by total time over a 30 minute monitoring period in this report https://console.postgres.ai/gitlab/gitlab_production/reports/425/files/113266/md#postgres-checkup_K003
SELECT a.attname, format_type(a.atttypid,
a.atttypmod),
pg_get_expr(
d.adbin, d.adrelid), a.attnotnull,
a.atttypid, a.atttypmod,
c.collname, col_description(a.attrelid,
a.attnum) AS comment
FROM pg_attribute
a
LEFT JOIN pg_attrdef d ON a.attrelid
= d.adrelid AND a.attnum = d.adnum
LEFT JOIN pg_type t ON a.atttypid
= t.oid
LEFT JOIN pg_collation
c ON a.attcollation = c.oid AND
a.attcollation <> t.typcollation
WHERE a.attrelid = $1::regclass
AND a.attnum > $2 AND NOT a.attisdropped
ORDER BY a.attnum
Data points
Calls
- 120,517
- 63.45/sec
- 1.00/call
- 1.84%"
Total Time
- "99,772.17 ms
- 52.528 ms/sec
- 0.828 ms/call
- 5.15%"
Elasticsearch with PostgreSQL slow logs
Not much data in this one https://log.gprd.gitlab.net/goto/639eb5d2c7db8d538eca81b7be742545
Edited by Dylan Griffith