explain.depesz.com

PostgreSQL's explain analyze made readable

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

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 0.089 4,126.689 ↑ 23.3 7 1

Merge Join (cost=1,099,310.60..1,099,322.58 rows=163 width=148) (actual time=4,126.640..4,126.689 rows=7 loops=1)

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

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

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

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

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

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

5. 0.449 1.823 ↑ 23.3 7 1

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

  • Group Key: campaigns.date
6. 1.374 1.374 ↑ 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.019..1.374 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.010 0.024 ↑ 11.0 1 1

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

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

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

9. 0.022 4,124.731 ↑ 23.3 7 1

Sort (cost=1,098,038.38..1,098,038.78 rows=163 width=12) (actual time=4,124.729..4,124.731 rows=7 loops=1)

  • Sort Key: wid.date DESC
  • Sort Method: quicksort Memory: 25kB
10. 0.003 4,124.709 ↑ 23.3 7 1

Subquery Scan on wid (cost=1,098,029.13..1,098,032.39 rows=163 width=12) (actual time=4,124.707..4,124.709 rows=7 loops=1)

11. 53.917 4,124.706 ↑ 23.3 7 1

HashAggregate (cost=1,098,029.13..1,098,030.76 rows=163 width=20) (actual time=4,124.706..4,124.706 rows=7 loops=1)

  • Group Key: widgets.date
12. 2,781.425 4,070.789 ↑ 7.3 199,609 1

Bitmap Heap Scan on widgets (cost=24,004.35..1,090,719.76 rows=1,461,873 width=8) (actual time=1,487.680..4,070.789 rows=199,609 loops=1)

  • Recheck Cond: ((date >= '2019-06-06'::date) AND (date <= '2019-06-12'::date))
  • Filter: (source_id = 12)
  • Rows Removed by Filter: 1712031
  • Heap Blocks: exact=461064
13. 1,289.364 1,289.364 ↓ 1.1 1,917,150 1

Bitmap Index Scan on widgets_date_idx (cost=0.00..23,638.88 rows=1,779,084 width=0) (actual time=1,289.364..1,289.364 rows=1,917,150 loops=1)

  • Index Cond: ((date >= '2019-06-06'::date) AND (date <= '2019-06-12'::date))
Planning time : 0.573 ms
Execution time : 4,126.823 ms