explain.depesz.com

PostgreSQL's explain analyze made readable

Result: LPpW : test

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

Limit (cost=5,805,341.56..5,904,272.06 rows=1,000 width=211) (actual rows= loops=)

2.          

CTE team_scheduling_visit_temp

3. 0.000 0.000 ↓ 0.0

Gather (cost=1,247.16..29,568.06 rows=379 width=29) (actual rows= loops=)

  • Workers Planned: 2
4. 0.000 0.000 ↓ 0.0

Nested Loop (cost=247.16..28,530.16 rows=158 width=29) (actual rows= loops=)

5. 0.000 0.000 ↓ 0.0

Nested Loop (cost=246.73..27,620.62 rows=80 width=25) (actual rows= loops=)

6. 0.000 0.000 ↓ 0.0

Parallel Bitmap Heap Scan on team_scheduling_visit tv (cost=246.31..26,953.55 rows=80 width=21) (actual rows= loops=)

  • Recheck Cond: ((current_status_id)::text = 'in-progress'::text)
  • Filter: ((continuity_initialized_date IS NULL) AND (scheduled_end_date < date_trunc('month'::text, (CURRENT_DATE + '1 mon'::interval month))) AND (scheduled_end_date >= date_trunc('month'::text, (CURRENT_DATE)::timestamp with time zone)))
7. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on team_scheduling_visit_current_status_id_3b675c295218cb6d_like (cost=0.00..246.26 rows=8,777 width=0) (actual rows= loops=)

  • Index Cond: ((current_status_id)::text = 'in-progress'::text)
8. 0.000 0.000 ↓ 0.0

Index Scan using projects_projectstore_pkey on projects_projectstore ps (cost=0.42..8.34 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (id = tv.store_id)
9. 0.000 0.000 ↓ 0.0

Index Scan using team_scheduling_shift_ea367887 on team_scheduling_shift ts (cost=0.43..11.26 rows=11 width=8) (actual rows= loops=)

  • Index Cond: (visit_id = tv.id)
10.          

CTE action_items_temp

11. 0.000 0.000 ↓ 0.0

Hash Join (cost=1,595.15..5,775,759.24 rows=162,738,884 width=111) (actual rows= loops=)

  • Hash Cond: (ca.item_id = im.id)
12. 0.000 0.000 ↓ 0.0

Hash Join (cost=697.33..5,347,087.29 rows=162,903,447 width=107) (actual rows= loops=)

  • Hash Cond: (ca.action_config_id = cfg.id)
13. 0.000 0.000 ↓ 0.0

Seq Scan on continuity_actionitem ca (cost=0.00..4,894,683.92 rows=171,992,131 width=24) (actual rows= loops=)

  • Filter: ((NOT item_pause) AND (NOT store_pause) AND (unregistered_timestamp IS NULL))
14. 0.000 0.000 ↓ 0.0

Hash (cost=597.40..597.40 rows=7,994 width=87) (actual rows= loops=)

15. 0.000 0.000 ↓ 0.0

Seq Scan on continuity_actionconfig cfg (cost=0.00..597.40 rows=7,994 width=87) (actual rows= loops=)

  • Filter: (NOT is_paused)
16. 0.000 0.000 ↓ 0.0

Hash (cost=749.49..749.49 rows=11,867 width=8) (actual rows= loops=)

17. 0.000 0.000 ↓ 0.0

Seq Scan on item_master_item im (cost=0.00..749.49 rows=11,867 width=8) (actual rows= loops=)

  • Filter: ((unregistered_timestamp IS NULL) AND ((current_status_id)::text = 'active'::text))
18. 0.000 0.000 ↓ 0.0

Nested Loop (cost=14.26..27,652,771.63 rows=279,517 width=211) (actual rows= loops=)

19. 0.000 0.000 ↓ 0.0

Nested Loop (cost=13.98..27,569,309.59 rows=279,517 width=215) (actual rows= loops=)

  • Join Filter: (tvt.cycle_id = pc.id)
20. 0.000 0.000 ↓ 0.0

Nested Loop (cost=13.70..27,479,857.49 rows=279,517 width=211) (actual rows= loops=)

21. 0.000 0.000 ↓ 0.0

Hash Join (cost=13.27..19,544,098.86 rows=1,541,951 width=211) (actual rows= loops=)

  • Hash Cond: ((ait.project_cycle_id = tvt.cycle_id) AND (ait.project_store_id = tvt.project_store_id))
22. 0.000 0.000 ↓ 0.0

CTE Scan on action_items_temp ait (cost=0.00..3,254,777.68 rows=162,738,884 width=179) (actual rows= loops=)

23. 0.000 0.000 ↓ 0.0

Hash (cost=7.58..7.58 rows=379 width=36) (actual rows= loops=)

24. 0.000 0.000 ↓ 0.0

CTE Scan on team_scheduling_visit_temp tvt (cost=0.00..7.58 rows=379 width=36) (actual rows= loops=)

25. 0.000 0.000 ↓ 0.0

Index Only Scan using continuity_actionitemvisit_visit_id_item_group_id_e01d68a3_uniq on continuity_actionitemvisit atv (cost=0.43..5.15 rows=1 width=8) (actual rows= loops=)

  • Index Cond: ((visit_id = tvt.id) AND (item_group_id = ait.item_group_id))
26. 0.000 0.000 ↓ 0.0

Index Scan using projects_projectcycle_pkey on projects_projectcycle pc (cost=0.29..0.31 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (id = ait.project_cycle_id)
27. 0.000 0.000 ↓ 0.0

Index Only Scan using projects_project_pkey on projects_project pp (cost=0.28..0.30 rows=1 width=4) (actual rows= loops=)