explain.depesz.com

PostgreSQL's explain analyze made readable

Result: UosP : pgstat

Settings
# exclusive inclusive rows x rows loops node
1. 15.127 328,270.477 ↓ 5.2 1,501 1

GroupAggregate (cost=581,795.86..581,814.65 rows=289 width=104) (actual time=328,252.890..328,270.477 rows=1,501 loops=1)

  • Group Key: ((floor((date_part('epoch'::text, (pgstat_activity.ts)::timestamp with time zone) / '60'::double precision)) * '60'::double precision)), (((((((((pgstat_activity.hostname || '_'::text) || pgstat_activity.port) || ' '::text) || pgstat_activity. (...)
2. 148.055 328,255.350 ↓ 55.4 15,999 1

Sort (cost=581,795.86..581,796.59 rows=289 width=47) (actual time=328,252.862..328,255.350 rows=15,999 loops=1)

  • Sort Key: ((floor((date_part('epoch'::text, (pgstat_activity.ts)::timestamp with time zone) / '60'::double precision)) * '60'::double precision)), (((((((((pgstat_activity.hostname || '_'::text) || pgstat_activity.port) || ' '::text) || pgstat_acti (...)
  • Sort Method: quicksort Memory: 4,207kB
3. 163.213 328,107.295 ↓ 55.4 15,999 1

Nested Loop (cost=0.00..581,784.05 rows=289 width=47) (actual time=326,352.935..328,107.295 rows=15,999 loops=1)

4. 327,552.034 327,552.034 ↓ 85.1 24,503 1

Seq Scan on pgstat_activity (cost=0.00..579,576.58 rows=288 width=85) (actual time=326,293.936..327,552.034 rows=24,503 loops=1)

  • Filter: (((ts)::timestamp with time zone >= '2020-10-15 01:55:00+02'::timestamp with time zone) AND ((ts)::timestamp with time zone <= '2020-10-15 07:50:00+02'::timestamp with time zone) AND (((hostname || '_'::text) || port) = '172.16. (...)
  • Rows Removed by Filter: 11,489,899
5. 392.048 392.048 ↑ 1.0 1 24,503

Index Scan using idx_pdstat_query_md5query on pgstat_query (cost=0.00..7.62 rows=1 width=935) (actual time=0.012..0.016 rows=1 loops=24,503)

  • Index Cond: (md5_query = pgstat_activity._md5)
  • Filter: (regexp_replace(_query, '[\n\r]+'::text, ' '::text, 'g'::text) !~~ '%COMMIT%'::text)
  • Rows Removed by Filter: 0
Planning time : 1.420 ms
Execution time : 328,271.267 ms