explain.depesz.com

PostgreSQL's explain analyze made readable

Result: bxGg : Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: plan #X7OV; plan #4qTb; plan #oZWp; plan #Vm5S; plan #Xoct

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.086 8,121.230 ↑ 23.3 7 1

Merge Join (cost=1,136,677.00..1,136,688.99 rows=163 width=148) (actual time=8,121.183..8,121.230 rows=7 loops=1)

  • Merge Cond: (b.date = wid.date)
2. 0.005 2.442 ↑ 23.3 7 1

Merge Left Join (cost=1,272.22..1,273.20 rows=163 width=92) (actual time=2.439..2.442 rows=7 loops=1)

  • Merge Cond: (b.date = n.date)
3. 0.011 1.914 ↑ 23.3 7 1

Sort (cost=1,270.92..1,271.33 rows=163 width=60) (actual time=1.913..1.914 rows=7 loops=1)

  • Sort Key: b.date DESC
  • Sort Method: quicksort Memory: 25kB
4. 0.001 1.903 ↑ 23.3 7 1

Subquery Scan on b (cost=0.29..1,264.93 rows=163 width=60) (actual time=0.432..1.903 rows=7 loops=1)

5. 0.404 1.902 ↑ 23.3 7 1

GroupAggregate (cost=0.29..1,263.30 rows=163 width=64) (actual time=0.432..1.902 rows=7 loops=1)

  • Group Key: campaigns.date
6. 1.498 1.498 ↑ 1.0 1,575 1

Index Scan using boosts_pkey on campaigns (cost=0.29..1,214.75 rows=1,647 width=32) (actual time=0.012..1.498 rows=1,575 loops=1)

  • Index Cond: ((date >= '2019-06-06'::date) AND (date <= '2019-06-12'::date))
  • Filter: (source_id = 12)
  • Rows Removed by Filter: 238
7. 0.008 0.523 ↑ 11.0 1 1

Sort (cost=1.30..1.33 rows=11 width=36) (actual time=0.523..0.523 rows=1 loops=1)

  • Sort Key: n.date DESC
  • Sort Method: quicksort Memory: 25kB
8. 0.515 0.515 ↑ 1.0 11 1

Seq Scan on notes n (cost=0.00..1.11 rows=11 width=36) (actual time=0.511..0.515 rows=11 loops=1)

9. 0.019 8,118.702 ↑ 23.3 7 1

Sort (cost=1,135,404.78..1,135,405.19 rows=163 width=12) (actual time=8,118.699..8,118.702 rows=7 loops=1)

  • Sort Key: wid.date DESC
  • Sort Method: quicksort Memory: 25kB
10. 0.001 8,118.683 ↑ 23.3 7 1

Subquery Scan on wid (cost=1,135,395.54..1,135,398.80 rows=163 width=12) (actual time=8,118.680..8,118.683 rows=7 loops=1)

11. 62.839 8,118.682 ↑ 23.3 7 1

HashAggregate (cost=1,135,395.54..1,135,397.17 rows=163 width=20) (actual time=8,118.679..8,118.682 rows=7 loops=1)

  • Group Key: widgets.date
12. 6,838.276 8,055.843 ↑ 7.7 199,500 1

Bitmap Heap Scan on widgets (cost=25,438.98..1,127,691.40 rows=1,540,827 width=8) (actual time=1,285.390..8,055.843 rows=199,500 loops=1)

  • Recheck Cond: ((date >= '2019-06-06'::date) AND (date <= '2019-06-12'::date))
  • Rows Removed by Index Recheck: 2122539
  • Filter: (source_id = 12)
  • Rows Removed by Filter: 1711691
  • Heap Blocks: exact=122988 lossy=339674
13. 1,217.567 1,217.567 ↓ 1.1 2,118,537 1

Bitmap Index Scan on widgets_date_idx (cost=0.00..25,053.78 rows=1,886,804 width=0) (actual time=1,217.567..1,217.567 rows=2,118,537 loops=1)

  • Index Cond: ((date >= '2019-06-06'::date) AND (date <= '2019-06-12'::date))
Planning time : 1.880 ms
Execution time : 8,121.461 ms