explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ZqOR : Optimization for: Optimization for: Optimization for: plan #LaHU; plan #IaEQ; plan #ewLA

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.070 1,063.203 ↑ 29.6 72 1

Sort (cost=180,846.37..180,851.71 rows=2,134 width=220) (actual time=1,063.199..1,063.203 rows=72 loops=1)

  • Sort Key: (sum(b.cost)) DESC
  • Sort Method: quicksort Memory: 62kB
2. 0.656 1,063.133 ↑ 29.6 72 1

Hash Join (cost=180,590.62..180,728.37 rows=2,134 width=220) (actual time=1,063.005..1,063.133 rows=72 loops=1)

  • Hash Cond: (widgets.imb_id = b.imb_id)
3. 319.279 935.274 ↑ 3.9 176 1

HashAggregate (cost=174,950.19..174,957.03 rows=684 width=20) (actual time=935.249..935.274 rows=176 loops=1)

  • Group Key: widgets.imb_id
4. 615.995 615.995 ↓ 1.3 1,772,282 1

Index Scan using widgets_date_idx on widgets (cost=0.57..164,842.78 rows=1,347,655 width=12) (actual time=0.019..615.995 rows=1,772,282 loops=1)

  • Index Cond: ((date >= '2019-04-28'::date) AND (date <= '2019-05-10'::date))
  • Filter: (source_id = 12)
  • Rows Removed by Filter: 9099
5. 0.095 127.203 ↑ 7.8 80 1

Hash (cost=5,632.62..5,632.62 rows=624 width=163) (actual time=127.203..127.203 rows=80 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 25kB
6. 0.085 127.108 ↑ 7.8 80 1

Hash Left Join (cost=4,200.21..5,632.62 rows=624 width=163) (actual time=101.835..127.108 rows=80 loops=1)

  • Hash Cond: (b.imb_id = names.imb_id)
7. 0.481 125.688 ↑ 7.8 80 1

Hash Right Join (cost=4,153.77..5,577.61 rows=624 width=124) (actual time=100.484..125.688 rows=80 loops=1)

  • Hash Cond: (d1.imb_id = b.imb_id)
8. 0.000 83.755 ↓ 4.5 580 1

Nested Loop (cost=3,152.06..4,564.80 rows=128 width=28) (actual time=58.186..83.755 rows=580 loops=1)

9. 17.050 58.377 ↓ 1.1 978 1

HashAggregate (cost=3,151.77..3,161.07 rows=930 width=8) (actual time=58.028..58.377 rows=978 loops=1)

  • Group Key: campaigns.imb_id
10. 41.327 41.327 ↑ 1.0 94,318 1

Seq Scan on campaigns (cost=0.00..2,680.18 rows=94,318 width=8) (actual time=0.021..41.327 rows=94,318 loops=1)

11. 25.428 25.428 ↑ 1.0 1 978

Index Scan using boosts_pkey on campaigns d1 (cost=0.29..1.49 rows=1 width=32) (actual time=0.025..0.026 rows=1 loops=978)

  • Index Cond: ((date = (max(campaigns.date))) AND (imb_id = campaigns.imb_id))
  • Filter: (bid IS NOT NULL)
  • Rows Removed by Filter: 0
12. 0.025 41.452 ↑ 7.8 80 1

Hash (cost=993.91..993.91 rows=624 width=100) (actual time=41.452..41.452 rows=80 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 19kB
13. 0.543 41.427 ↑ 7.8 80 1

HashAggregate (cost=954.91..987.67 rows=624 width=100) (actual time=41.379..41.427 rows=80 loops=1)

  • Group Key: b.imb_id
  • Filter: (sum(b.ts_clicks) > 0)
  • Rows Removed by Filter: 4
14. 40.884 40.884 ↑ 1.6 640 1

Index Scan using boosts_pkey on campaigns b (cost=0.29..900.89 rows=1,029 width=36) (actual time=2.894..40.884 rows=640 loops=1)

  • Index Cond: ((date >= '2019-04-28'::date) AND (date <= '2019-05-10'::date))
  • Filter: ((ts_id IS NOT NULL) AND (cost > '0'::double precision))
  • Rows Removed by Filter: 2135
15. 0.341 1.335 ↑ 1.0 1,486 1

Hash (cost=27.86..27.86 rows=1,486 width=43) (actual time=1.335..1.335 rows=1,486 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 114kB
16. 0.994 0.994 ↑ 1.0 1,486 1

Seq Scan on campaign_names_groups names (cost=0.00..27.86 rows=1,486 width=43) (actual time=0.238..0.994 rows=1,486 loops=1)

Planning time : 14.746 ms
Execution time : 1,063.593 ms