explain.depesz.com

PostgreSQL's explain analyze made readable

Result: wqyO : Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: plan #X7OV; plan #4qTb; plan #oZWp; plan #Vm5S; plan #Xoct; plan #bxGg; plan #DmE2; plan #pXI7; plan #FDqQM; plan #LiQb; plan #BnPX

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 2.197 5,245.404 ↑ 79.6 13 1

Merge Join (cost=128,303.44..128,373.43 rows=1,035 width=148) (actual time=5,245.305..5,245.404 rows=13 loops=1)

  • Merge Cond: (b.date = wid.date)
2. 0.005 7.220 ↑ 25.1 13 1

Merge Left Join (cost=349.50..351.40 rows=326 width=75) (actual time=7.214..7.220 rows=13 loops=1)

  • Merge Cond: (b.date = n.date)
3. 0.033 7.156 ↑ 25.1 13 1

Sort (cost=348.20..349.02 rows=326 width=60) (actual time=7.153..7.156 rows=13 loops=1)

  • Sort Key: b.date DESC
  • Sort Method: quicksort Memory: 26kB
4. 0.114 7.123 ↑ 25.1 13 1

Subquery Scan on b (cost=0.29..334.60 rows=326 width=60) (actual time=0.961..7.123 rows=13 loops=1)

5. 0.459 7.009 ↑ 25.1 13 1

GroupAggregate (cost=0.29..331.34 rows=326 width=64) (actual time=0.850..7.009 rows=13 loops=1)

  • Group Key: campaigns.date
6. 6.550 6.550 ↓ 1.5 682 1

Index Scan using boosts_pkey on campaigns (cost=0.29..312.33 rows=454 width=32) (actual time=0.303..6.550 rows=682 loops=1)

  • Index Cond: ((date >= '2019-05-28'::date) AND (date <= '2019-06-12'::date))
  • Filter: (source_id = 12)
  • Rows Removed by Filter: 282
7. 0.017 0.059 ↑ 11.0 1 1

Sort (cost=1.30..1.33 rows=11 width=19) (actual time=0.059..0.059 rows=1 loops=1)

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

Seq Scan on notes n (cost=0.00..1.11 rows=11 width=19) (actual time=0.040..0.042 rows=11 loops=1)

9. 0.034 5,235.987 ↑ 48.8 13 1

Sort (cost=127,953.93..127,955.52 rows=635 width=12) (actual time=5,235.984..5,235.987 rows=13 loops=1)

  • Sort Key: wid.date DESC
  • Sort Method: quicksort Memory: 25kB
10. 0.007 5,235.953 ↑ 48.8 13 1

Subquery Scan on wid (cost=0.44..127,924.37 rows=635 width=12) (actual time=71.618..5,235.953 rows=13 loops=1)

11. 33.961 5,235.946 ↑ 48.8 13 1

GroupAggregate (cost=0.44..127,918.02 rows=635 width=20) (actual time=71.617..5,235.946 rows=13 loops=1)

  • Group Key: widgets.date
12. 5,201.985 5,201.985 ↑ 2.7 342,798 1

Index Scan using widgets_date_idx on widgets (cost=0.44..123,282.76 rows=925,782 width=8) (actual time=0.662..5,201.985 rows=342,798 loops=1)

  • Index Cond: ((date >= '2019-05-28'::date) AND (date <= '2019-06-12'::date))
  • Filter: (source_id = 12)
  • Rows Removed by Filter: 2492343
Planning time : 95.237 ms
Execution time : 5,245.704 ms