explain.depesz.com

PostgreSQL's explain analyze made readable

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

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.255 49,917.802 ↑ 23.3 7 1

Nested Loop (cost=1,272.66..1,106,525.36 rows=163 width=148) (actual time=49,917.745..49,917.802 rows=7 loops=1)

  • Join Filter: (b.date = wid.date)
  • Rows Removed by Join Filter: 42
2. 0.009 3.858 ↑ 23.3 7 1

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

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

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

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

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

5. 0.445 2.701 ↑ 23.3 7 1

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

  • Group Key: campaigns.date
6. 2.256 2.256 ↑ 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.023..2.256 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.015 1.121 ↑ 11.0 1 1

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

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

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

9. 0.023 49,913.689 ↑ 23.3 7 7

Materialize (cost=0.44..1,104,845.88 rows=163 width=12) (actual time=123.731..7,130.527 rows=7 loops=7)

10. 0.010 49,913.666 ↑ 23.3 7 1

Subquery Scan on wid (cost=0.44..1,104,845.07 rows=163 width=12) (actual time=866.109..49,913.666 rows=7 loops=1)

11. 46.875 49,913.656 ↑ 23.3 7 1

GroupAggregate (cost=0.44..1,104,843.44 rows=163 width=20) (actual time=866.107..49,913.656 rows=7 loops=1)

  • Group Key: widgets.date
12. 49,866.781 49,866.781 ↑ 7.3 199,500 1

Index Scan using widgets_date_idx on widgets (cost=0.44..1,097,564.62 rows=1,455,438 width=8) (actual time=350.572..49,866.781 rows=199,500 loops=1)

  • Index Cond: ((date >= '2019-06-06'::date) AND (date <= '2019-06-12'::date))
  • Filter: (source_id = 12)
  • Rows Removed by Filter: 1709402
Planning time : 10.009 ms
Execution time : 49,918.064 ms