explain.depesz.com

PostgreSQL's explain analyze made readable

Result: qoDP

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

Subquery Scan on sb3 (cost=97.22..113.65 rows=90 width=1,798) (actual rows= loops=)

2. 0.000 0.000 ↓ 0.0

WindowAgg (cost=97.22..106.22 rows=90 width=1,626) (actual rows= loops=)

3. 0.000 0.000 ↓ 0.0

Sort (cost=97.22..97.45 rows=90 width=1,398) (actual rows= loops=)

  • Sort Key: sb1.campaign_id, (CASE WHEN ((lower(sb1.aasm_state) = 'approved'::text) OR (lower(sb1.status_name) = 'planning'::text)) THEN sb1.media_plan_end_date ELSE NULL::date END) DESC NULLS LAST
4. 0.000 0.000 ↓ 0.0

WindowAgg (cost=89.80..94.30 rows=90 width=1,398) (actual rows= loops=)

5. 0.000 0.000 ↓ 0.0

Sort (cost=89.80..90.03 rows=90 width=1,394) (actual rows= loops=)

  • Sort Key: sb1.campaign_id, (CASE WHEN ((lower(sb1.aasm_state) = 'approved'::text) OR (lower(sb1.status_name) = 'planning'::text)) THEN sb1.media_plan_start_date ELSE NULL::date END) DESC NULLS LAST
6. 0.000 0.000 ↓ 0.0

Subquery Scan on sb1 (cost=77.43..86.88 rows=90 width=1,394) (actual rows= loops=)

7. 0.000 0.000 ↓ 0.0

WindowAgg (cost=77.43..84.18 rows=90 width=1,580) (actual rows= loops=)

8. 0.000 0.000 ↓ 0.0

Sort (cost=77.43..77.66 rows=90 width=1,454) (actual rows= loops=)

  • Sort Key: mp.campaign_id
9. 0.000 0.000 ↓ 0.0

WindowAgg (cost=72.71..74.51 rows=90 width=1,454) (actual rows= loops=)

10. 0.000 0.000 ↓ 0.0

Sort (cost=72.71..72.94 rows=90 width=1,446) (actual rows= loops=)

  • Sort Key: li.media_plan_id
11. 0.000 0.000 ↓ 0.0

WindowAgg (cost=67.99..69.79 rows=90 width=1,446) (actual rows= loops=)

12. 0.000 0.000 ↓ 0.0

Sort (cost=67.99..68.21 rows=90 width=1,438) (actual rows= loops=)

  • Sort Key: li.tactic_id
13. 0.000 0.000 ↓ 0.0

Hash Join (cost=31.67..65.07 rows=90 width=1,438) (actual rows= loops=)

  • Hash Cond: (mp.campaign_id = c.id)
14. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=19.42..51.58 rows=90 width=798) (actual rows= loops=)

  • Hash Cond: (li.id = lida.id)
15. 0.000 0.000 ↓ 0.0

Hash Join (cost=12.03..43.16 rows=90 width=782) (actual rows= loops=)

  • Hash Cond: (li.media_plan_id = mp.id)
16. 0.000 0.000 ↓ 0.0

Append (cost=0.00..29.49 rows=200 width=430) (actual rows= loops=)

17. 0.000 0.000 ↓ 0.0

Seq Scan on line_items li (cost=0.00..0.00 rows=1 width=1,364) (actual rows= loops=)

  • Filter: (NOT is_deleted)
18. 0.000 0.000 ↓ 0.0

Seq Scan on line_items_direct li_1 (cost=0.00..19.19 rows=184 width=349) (actual rows= loops=)

  • Filter: (NOT is_deleted)
19. 0.000 0.000 ↓ 0.0

Seq Scan on line_items_dsp li_2 (cost=0.00..10.30 rows=15 width=1,364) (actual rows= loops=)

  • Filter: (NOT is_deleted)
20. 0.000 0.000 ↓ 0.0

Hash (cost=10.90..10.90 rows=90 width=352) (actual rows= loops=)

21. 0.000 0.000 ↓ 0.0

Seq Scan on media_plans mp (cost=0.00..10.90 rows=90 width=352) (actual rows= loops=)

22. 0.000 0.000 ↓ 0.0

Hash (cost=5.51..5.51 rows=151 width=53) (actual rows= loops=)

23. 0.000 0.000 ↓ 0.0

Seq Scan on line_item_dates lida (cost=0.00..5.51 rows=151 width=53) (actual rows= loops=)

24. 0.000 0.000 ↓ 0.0

Hash (cost=11.00..11.00 rows=100 width=640) (actual rows= loops=)

25. 0.000 0.000 ↓ 0.0

Seq Scan on campaigns c (cost=0.00..11.00 rows=100 width=640) (actual rows= loops=)