explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 1a1M

Settings
# exclusive inclusive rows x rows loops node
1. 0.160 21,266.071 ↓ 12.8 51 1

GroupAggregate (cost=1,060.37..1,060.51 rows=4 width=144) (actual time=21,265.927..21,266.071 rows=51 loops=1)

  • Group Key: lo.id, co.br_id
2. 0.032 21,265.911 ↓ 12.8 51 1

Sort (cost=1,060.37..1,060.38 rows=4 width=91) (actual time=21,265.908..21,265.911 rows=51 loops=1)

  • Sort Key: lo.id, co.br_id
  • Sort Method: quicksort Memory: 32kB
3. 0.000 21,265.879 ↓ 12.8 51 1

Nested Loop (cost=1,024.49..1,060.33 rows=4 width=91) (actual time=21,264.573..21,265.879 rows=51 loops=1)

4. 0.128 21,265.781 ↓ 5.7 51 1

Hash Join (cost=1,024.21..1,044.95 rows=9 width=44) (actual time=21,264.562..21,265.781 rows=51 loops=1)

  • Hash Cond: (s.co_id = co.lo_id)
5. 1.042 21,265.623 ↓ 6.7 1,506 1

GroupAggregate (cost=1,009.07..1,026.99 rows=224 width=80) (actual time=21,264.523..21,265.623 rows=1,506 loops=1)

  • Group Key: p.id, s.se_id, s.co_id, c.br_id
6. 1.344 21,264.581 ↓ 6.7 1,506 1

Sort (cost=1,009.07..1,009.63 rows=224 width=40) (actual time=21,264.510..21,264.581 rows=1,506 loops=1)

  • Sort Key: s.se_id, s.co_id, c.br_id
  • Sort Method: quicksort Memory: 166kB
7. 0.734 21,263.237 ↓ 6.7 1,506 1

Hash Left Join (cost=235.58..1,000.33 rows=224 width=40) (actual time=21,117.330..21,263.237 rows=1,506 loops=1)

  • Hash Cond: (s.co_id = c.lo_id)
8. 0.050 21,262.081 ↓ 6.7 1,506 1

Nested Loop Left Join (cost=192.52..956.67 rows=224 width=36) (actual time=21,116.896..21,262.081 rows=1,506 loops=1)

  • Join Filter: (t.pe_id = p.id)
9. 0.302 21,213.839 ↓ 6.7 1,506 1

Nested Loop (cost=192.24..619.22 rows=224 width=28) (actual time=21,116.574..21,213.839 rows=1,506 loops=1)

10. 21,115.573 21,115.573 ↑ 1.0 1 1

Seq Scan on rtpe p (cost=0.00..1.12 rows=1 width=8) (actual time=21,115.571..21,115.573 rows=1 loops=1)

  • Filter: (id = 3)
  • Rows Removed by Filter: 9
11. 97.802 97.964 ↓ 16.9 1,506 1

Bitmap Heap Scan on rtsepecoav s (cost=192.24..617.21 rows=89 width=20) (actual time=0.994..97.964 rows=1,506 loops=1)

  • Recheck Cond: ((pe_id = p.id) OR (pe_id = p.baseline_id))
  • Filter: (ad_id = find_ad('active'::text))
  • Rows Removed by Filter: 2,183
  • Heap Blocks: exact=28
12. 0.004 0.162 ↓ 0.0 0 1

BitmapOr (cost=192.24..192.24 rows=1,484 width=0) (actual time=0.162..0.162 rows=0 loops=1)

13. 0.158 0.158 ↓ 5.0 3,691 1

Bitmap Index Scan on rtsepecoav_unique (cost=0.00..96.10 rows=742 width=0) (actual time=0.158..0.158 rows=3,691 loops=1)

  • Index Cond: (pe_id = p.id)
14. 0.000 0.000 ↓ 0.0 0 1

Bitmap Index Scan on rtsepecoav_unique (cost=0.00..96.10 rows=742 width=0) (actual time=0.000..0.000 rows=0 loops=1)

  • Index Cond: (pe_id = p.baseline_id)
15. 48.192 48.192 ↓ 0.0 0 1,506

Index Scan using rtsepecoav_co_id_se_id_idx on rtsepecoav t (cost=0.28..1.49 rows=1 width=20) (actual time=0.032..0.032 rows=0 loops=1,506)

  • Index Cond: ((co_id = s.co_id) AND (se_id = s.se_id))
  • Filter: ((pe_id = 3) AND (ad_id = find_ad('takeover'::text)))
  • Rows Removed by Filter: 2
16. 0.232 0.422 ↓ 1.0 1,517 1

Hash (cost=24.14..24.14 rows=1,514 width=8) (actual time=0.422..0.422 rows=1,517 loops=1)

  • Buckets: 2,048 Batches: 1 Memory Usage: 76kB
17. 0.190 0.190 ↓ 1.0 1,517 1

Seq Scan on rtco c (cost=0.00..24.14 rows=1,514 width=8) (actual time=0.008..0.190 rows=1,517 loops=1)

18. 0.009 0.030 ↓ 1.1 62 1

Hash (cost=14.40..14.40 rows=59 width=8) (actual time=0.030..0.030 rows=62 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 11kB
19. 0.013 0.021 ↓ 1.1 62 1

Bitmap Heap Scan on rtco co (cost=4.73..14.40 rows=59 width=8) (actual time=0.013..0.021 rows=62 loops=1)

  • Recheck Cond: (br_id = ANY ('{3035353}'::integer[]))
  • Heap Blocks: exact=2
20. 0.008 0.008 ↓ 1.1 62 1

Bitmap Index Scan on rtco_br_id_idx (cost=0.00..4.72 rows=59 width=0) (actual time=0.008..0.008 rows=62 loops=1)

  • Index Cond: (br_id = ANY ('{3035353}'::integer[]))
21. 0.102 0.102 ↑ 1.0 1 51

Index Scan using rtlo_pkey on rtlo lo (cost=0.28..1.71 rows=1 width=55) (actual time=0.001..0.002 rows=1 loops=51)

  • Index Cond: (id = s.co_id)