explain.depesz.com

PostgreSQL's explain analyze made readable

Result: MqDD

Settings
# exclusive inclusive rows x rows loops node
1. 0.016 20,908.837 ↑ 1.0 1 1

Nested Loop (cost=11.36..1,108,841.70 rows=1 width=222) (actual time=20,906.924..20,908.837 rows=1 loops=1)

2. 0.021 20,908.808 ↑ 1.0 1 1

Nested Loop (cost=11.36..1,108,839.91 rows=1 width=226) (actual time=20,906.901..20,908.808 rows=1 loops=1)

  • Join Filter: (bannerset.advertiser_id = advertiser.advertiser_id)
  • Rows Removed by Join Filter: 43
3. 0.008 20,908.692 ↑ 1.0 1 1

Nested Loop Left Join (cost=11.36..1,108,826.97 rows=1 width=212) (actual time=20,906.850..20,908.692 rows=1 loops=1)

  • Join Filter: (bannerset.bannerset_id = bannerset_1.bannerset_id)
4. 4.427 4.427 ↑ 1.0 1 1

Index Scan using ix_bannerset_advertiser_id on bannerset (cost=0.29..1,616.33 rows=1 width=116) (actual time=2.587..4.427 rows=1 loops=1)

  • Filter: (bannerset_id = 11481)
  • Rows Removed by Filter: 10136
5. 0.002 20,904.257 ↓ 0.0 0 1

GroupAggregate (cost=11.07..1,107,210.62 rows=1 width=28) (actual time=20,904.257..20,904.257 rows=0 loops=1)

  • Group Key: bannerset_1.bannerset_id
6. 0.002 20,904.255 ↓ 0.0 0 1

Nested Loop (cost=11.07..1,107,174.47 rows=3,613 width=28) (actual time=20,904.255..20,904.255 rows=0 loops=1)

7. 0.009 0.009 ↑ 1.0 1 1

Index Only Scan using bannerset_pkey on bannerset bannerset_1 (cost=0.29..8.30 rows=1 width=4) (actual time=0.007..0.009 rows=1 loops=1)

  • Index Cond: (bannerset_id = 11481)
  • Heap Fetches: 1
8. 7,875.144 20,904.244 ↓ 0.0 0 1

Hash Join (cost=10.79..1,107,130.04 rows=3,613 width=28) (actual time=20,904.244..20,904.244 rows=0 loops=1)

  • Hash Cond: (adset_creative_stat.creative_id = creative.creative_id)
9. 13,029.071 13,029.071 ↑ 1.0 36,234,660 1

Seq Scan on adset_creative_stat (cost=0.00..971,176.22 rows=36,241,840 width=28) (actual time=0.011..13,029.071 rows=36,234,660 loops=1)

  • Filter: ((hour >= 385703) AND (hour <= 435608))
10. 0.004 0.029 ↓ 1.7 5 1

Hash (cost=10.75..10.75 rows=3 width=8) (actual time=0.029..0.029 rows=5 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
11. 0.025 0.025 ↓ 1.7 5 1

Index Scan using ix_creative_bannerset_id on creative (cost=0.29..10.75 rows=3 width=8) (actual time=0.014..0.025 rows=5 loops=1)

  • Index Cond: (bannerset_id = 11481)
12. 0.095 0.095 ↑ 1.0 44 1

Seq Scan on advertiser (cost=0.00..12.38 rows=45 width=18) (actual time=0.019..0.095 rows=44 loops=1)

  • Filter: (agency_id = 2)
  • Rows Removed by Filter: 388
13. 0.013 0.013 ↑ 1.0 1 1

Seq Scan on agency (cost=0.00..1.76 rows=1 width=4) (actual time=0.007..0.013 rows=1 loops=1)

  • Filter: (agency_id = 2)
  • Rows Removed by Filter: 60
Planning time : 0.540 ms
Execution time : 20,909.485 ms