explain.anayrat.info

PostgreSQL's explain analyze made readable

Result: JA

Settings
# exclusive inclusive rows x rows loops read written node
1. 0.007 4,003.546 ↓ 22.0 22 1 0 0

Limit (cost=998.53..998.58 rows=1 width=232) (actual time=4,003.365..4,003.546 rows=22 loops=1)

  • Memory: used=462kB allocated=512kB
  • Serialization: time=0.210 ms output=14kB format=text
  • Buffers: shared hit=478,049 read=418, temp read=34,033 written=34,037
  • I/O Timings: shared read=1.346, temp read=251.850 write=513.695
2. 0.179 4,003.539 ↓ 22.0 22 1 0 0

GroupAggregate (cost=998.53..998.58 rows=1 width=232) (actual time=4,003.363..4,003.539 rows=22 loops=1)

  • Group Key: (sum("*SELECT* 1".occurences)), "*SELECT* 1".qualid, (sum("*SELECT* 1".execution_count)), (((to_json(pqnh.quals)))::jsonb), ((sum("*SELECT* 1".nbfiltered) / sum("*SELECT* 1".occurences))), (CASE WHEN (sum("*SELECT* 1".execution_count) = '0'::numeric) THEN '0'::numeric ELSE ((sum("*SELECT* 1".nbfiltered) / sum("*SELECT* 1".execution_count)) * '100'::numeric) END)
  • Buffers: shared hit=478,049 read=418, temp read=34,033 written=34,037
  • I/O Timings: shared read=1.346, temp read=251.850 write=513.695
3. 0.369 4,003.360 ↓ 47.0 47 1 0 0

Sort (cost=998.53..998.54 rows=1 width=724) (actual time=4,003.342..4,003.360 rows=47 loops=1)

  • Sort Key: (sum("*SELECT* 1".occurences)) DESC, "*SELECT* 1".qualid, (sum("*SELECT* 1".execution_count)), (((to_json(pqnh.quals)))::jsonb), ((sum("*SELECT* 1".nbfiltered) / sum("*SELECT* 1".occurences))), (CASE WHEN (sum("*SELECT* 1".execution_count) = '0'::numeric) THEN '0'::numeric ELSE ((sum("*SELECT* 1".nbfiltered) / sum("*SELECT* 1".execution_count)) * '100'::numeric) END)
  • Sort Method: quicksort Memory: 44kB
  • Buffers: shared hit=478,049 read=418, temp read=34,033 written=34,037
  • I/O Timings: shared read=1.346, temp read=251.850 write=513.695
4. 0.542 4,002.991 ↓ 47.0 47 1 0 0

Nested Loop (cost=993.94..998.52 rows=1 width=724) (actual time=2,653.876..4,002.991 rows=47 loops=1)

  • Buffers: shared hit=478,038 read=418, temp read=34,033 written=34,037
  • I/O Timings: shared read=1.346, temp read=251.850 write=513.695
5. 411.976 4,001.745 ↓ 64.0 64
- 67
1 0 0

GroupAggregate (cost=993.79..993.91 rows=1 width=764) (actual time=2,653.641..4,001.745 rows=64 loops=1)

  • Group Key: "*SELECT* 1".qualid, ps.queryid, ps.dbid, ps.query, pqnh.quals
  • Filter: (((sum("*SELECT* 1".nbfiltered) / sum("*SELECT* 1".occurences)) > '1000'::numeric) AND (CASE WHEN (sum("*SELECT* 1".execution_count) = '0'::numeric) THEN '0'::numeric ELSE ((sum("*SELECT* 1".nbfiltered) / sum("*SELECT* 1".execution_count)) * '100'::numeric) END > 0.3))
  • Rows Removed by Filter: 67
  • Buffers: shared hit=477,910 read=418, temp read=34,033 written=34,037
  • I/O Timings: shared read=1.346, temp read=251.850 write=513.695
6. 2,867.985 3,589.769 ↓ 177,397.5 354,795 1 266 MB
in 251.85 ms
~ 1.1 GB/s
266 MB
in 513.695 ms
~ 518 MB/s

Sort (cost=993.79..993.79 rows=2 width=628) (actual time=2,653.484..3,589.769 rows=354,795 loops=1)

  • Sort Key: "*SELECT* 1".qualid, ps.queryid, ps.dbid, ps.query, pqnh.quals
  • Sort Method: external merge Disk: 272,264kB
  • Buffers: shared hit=477,907 read=418, temp read=34,033 written=34,037
  • I/O Timings: shared read=1.346, temp read=251.850 write=513.695
7. 157.318 721.784 ↓ 177,397.5 354,795 1 0 0

Nested Loop (cost=33.32..993.78 rows=2 width=628) (actual time=1.252..721.784 rows=354,795 loops=1)

  • Buffers: shared hit=477,896 read=418
  • I/O Timings: shared read=1.346
8. 44.014 75.762 ↓ 61,088.0 61,088 1 0 0

Hash Join (cost=33.04..992.37 rows=1 width=84) (actual time=1.203..75.762 rows=61,088 loops=1)

  • Hash Cond: (("*SELECT* 1".queryid = pqnh.queryid) AND ("*SELECT* 1".qualid = pqnh.qualid))
  • Buffers: shared hit=274 read=418
  • I/O Timings: shared read=1.346
9. 3.008 30.874 ↓ 8.6 15,679 1 0 0

Append (cost=5.62..951.28 rows=1,822 width=44) (actual time=0.283..30.874 rows=15,679 loops=1)

  • Buffers: shared hit=185 read=418
  • I/O Timings: shared read=1.346
10. 3.494 22.853 ↓ 293.0 13,771 1 0 0

Subquery Scan on *SELECT* 1 (cost=5.62..346.41 rows=47 width=44) (actual time=0.282..22.853 rows=13,771 loops=1)

  • Buffers: shared hit=92
11. 9.755 19.359 ↓ 293.0 13,771
- 2,775
1 0 0

Subquery Scan on unnested (cost=5.62..345.94 rows=47 width=76) (actual time=0.280..19.359 rows=13,771 loops=1)

  • Filter: (((unnested.records).ts >= '2025-01-17 16:52:15+01'::timestamp with time zone) AND ((unnested.records).ts <= '2025-01-17 19:52:15+01'::timestamp with time zone))
  • Rows Removed by Filter: 2,775
  • Buffers: shared hit=92
12. 8.916 9.604 ↓ 1.8 16,546 1 0 0

ProjectSet (cost=5.62..206.02 rows=9,328 width=92) (actual time=0.274..9.604 rows=16,546 loops=1)

  • Buffers: shared hit=92
13. 0.451 0.688 ↓ 1.2 257 1 0 0

Bitmap Heap Scan on powa_qualstats_quals_history pqnh_1 (cost=5.62..157.79 rows=212 width=648) (actual time=0.267..0.688 rows=257 loops=1)

  • Recheck Cond: ((srvid = 1) AND (coalesce_range && '["2025-01-17 16:52:15+01","2025-01-17 19:52:15+01"]'::tstzrange))
  • Heap Blocks: exact=41
  • Buffers: shared hit=57
14. 0.237 0.237 ↓ 1.2 257 1 0 0

Bitmap Index Scan on powa_qualstats_quals_history_query_ts (cost=0.00..5.56 rows=212 width=0) (actual time=0.237..0.237 rows=257 loops=1)

  • Index Cond: ((srvid = 1) AND (coalesce_range && '["2025-01-17 16:52:15+01","2025-01-17 19:52:15+01"]'::tstzrange))
  • Buffers: shared hit=16
15. 0.456 5.013 ↓ 1.1 1,908 1 0 0

Subquery Scan on *SELECT* 2 (cost=0.00..595.76 rows=1,775 width=44) (actual time=0.276..5.013 rows=1,908 loops=1)

  • Buffers: shared hit=93 read=418
  • I/O Timings: shared read=1.346
16. 4.557 4.557 ↓ 1.1 1,908
- 2,512
1 3.3 MB
in 1.346 ms
~ 2.4 GB/s
0

Seq Scan on powa_qualstats_quals_history_current pqnc (cost=0.00..578.01 rows=1,775 width=76) (actual time=0.275..4.557 rows=1,908 loops=1)

  • Filter: ((ts >= '2025-01-17 16:52:15+01'::timestamp with time zone) AND (ts <= '2025-01-17 19:52:15+01'::timestamp with time zone) AND (srvid = 1))
  • Rows Removed by Filter: 2,512
  • Buffers: shared hit=93 read=418
  • I/O Timings: shared read=1.346
17. 0.083 0.874 ↓ 118.0 118 1 0 0

Hash (cost=27.40..27.40 rows=1 width=52) (actual time=0.870..0.874 rows=118 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 23kB
  • Buffers: shared hit=89
18. 0.027 0.791 ↓ 118.0 118 1 0 0

Subquery Scan on pqnh (cost=27.36..27.40 rows=1 width=52) (actual time=0.575..0.791 rows=118 loops=1)

  • Buffers: shared hit=89
19. 0.185 0.764 ↓ 118.0 118 1 0 0

GroupAggregate (cost=27.36..27.39 rows=1 width=60) (actual time=0.575..0.764 rows=118 loops=1)

  • Group Key: expanded.qualid, expanded.queryid, expanded.dbid, expanded.userid
  • Buffers: shared hit=89
20. 0.151 0.579 ↓ 144.0 144 1 0 0

Sort (cost=27.36..27.37 rows=1 width=60) (actual time=0.564..0.579 rows=144 loops=1)

  • Sort Key: expanded.qualid, expanded.queryid, expanded.dbid, expanded.userid
  • Sort Method: quicksort Memory: 36kB
  • Buffers: shared hit=89
21. 0.061 0.428 ↓ 144.0 144
- 118
1 0 0

Subquery Scan on expanded (cost=0.28..27.35 rows=1 width=60) (actual time=0.047..0.428 rows=144 loops=1)

  • Filter: ((expanded.qual).eval_type = 'f'::"char")
  • Rows Removed by Filter: 118
  • Buffers: shared hit=89
22. 0.197 0.367 ↓ 1.3 262 1 0 0

ProjectSet (cost=0.28..24.90 rows=196 width=60) (actual time=0.044..0.367 rows=262 loops=1)

  • Buffers: shared hit=89
23. 0.170 0.170 ↑ 1.0 196 1 0 0

Index Scan using powa_qualstats_quals_srvid_queryid_idx on powa_qualstats_quals (cost=0.28..22.45 rows=196 width=106) (actual time=0.034..0.170 rows=196 loops=1)

  • Index Cond: (srvid = 1)
  • Buffers: shared hit=89
24. 488.704 488.704 ↓ 3.0 366,528 61,088 0 0

Index Scan using powa_statements_pkey on powa_statements ps (cost=0.29..1.39 rows=2 width=564) (actual time=0.004..0.008 rows=6 loops=61,088)

  • Index Cond: ((srvid = 1) AND (queryid = "*SELECT* 1".queryid))
  • Buffers: shared hit=477,622
25. 0.704 0.704 ↑ 1.0 64 64 0 0

Index Scan using powa_databases_pkey on powa_databases pd (cost=0.15..2.37 rows=1 width=8) (actual time=0.011..0.011 rows=1 loops=64)

  • Index Cond: ((srvid = 1) AND (oid = ps.dbid))
  • Filter: (datname = 'tpc'::name)
  • Rows Removed by Filter: 0
  • Buffers: shared hit=128
Planning I/O : Buffers: shared hit=557
Planning time : 4.972 ms
Execution time : 4,077.035 ms
Custom settings:
effective_cache_size ? 500MB
effective_io_concurrency ? 200
jit_above_cost ? 5000
maintenance_io_concurrency ? 400
random_page_cost ? 1.1
work_mem ? 64MB