explain.depesz.com

PostgreSQL's explain analyze made readable

Result: FuG

Settings
# exclusive inclusive rows x rows loops node
1. 0.015 0.823 ↑ 1.0 1 1

Aggregate (cost=25.80..25.82 rows=1 width=32) (actual time=0.823..0.823 rows=1 loops=1)

2.          

CTE calendar_items

3. 0.644 0.644 ↑ 1.0 1 1

Index Scan using calendar_items_pkey on calendar_items (cost=0.42..8.44 rows=1 width=63) (actual time=0.638..0.644 rows=1 loops=1)

  • Index Cond: (id = 610,865)
4.          

CTE calendar_item_participants

5. 0.009 0.109 ↑ 1.0 1 1

Nested Loop (cost=0.59..8.67 rows=1 width=50) (actual time=0.107..0.109 rows=1 loops=1)

6. 0.005 0.065 ↑ 1.0 1 1

Nested Loop (cost=0.32..8.35 rows=1 width=18) (actual time=0.064..0.065 rows=1 loops=1)

7. 0.010 0.016 ↑ 1.0 1 1

HashAggregate (cost=0.02..0.03 rows=1 width=4) (actual time=0.015..0.016 rows=1 loops=1)

  • Group Key: calendar_items_1.id
8. 0.006 0.006 ↑ 1.0 1 1

CTE Scan on calendar_items calendar_items_1 (cost=0.00..0.02 rows=1 width=4) (actual time=0.000..0.006 rows=1 loops=1)

9. 0.044 0.044 ↑ 1.0 1 1

Index Scan using index_calendar_item_participants_on_calendar_item_id on calendar_item_participants (cost=0.29..8.31 rows=1 width=18) (actual time=0.044..0.044 rows=1 loops=1)

  • Index Cond: (calendar_item_id = calendar_items_1.id)
  • Filter: (deleted IS FALSE)
10. 0.035 0.035 ↑ 1.0 1 1

Index Scan using users_pkey1 on users (cost=0.28..0.30 rows=1 width=21) (actual time=0.035..0.035 rows=1 loops=1)

  • Index Cond: (id = calendar_item_participants.user_id)
11.          

CTE calendar_item_participant_json

12. 0.029 0.153 ↑ 1.0 1 1

HashAggregate (cost=0.03..0.04 rows=1 width=36) (actual time=0.152..0.153 rows=1 loops=1)

  • Group Key: calendar_item_participants_1.calendar_item_id
13. 0.124 0.124 ↑ 1.0 1 1

CTE Scan on calendar_item_participants calendar_item_participants_1 (cost=0.00..0.02 rows=1 width=32) (actual time=0.122..0.124 rows=1 loops=1)

14.          

CTE requisition_attributes

15. 0.001 0.003 ↓ 0.0 0 1

Nested Loop (cost=0.45..8.52 rows=1 width=33) (actual time=0.003..0.003 rows=0 loops=1)

16. 0.000 0.002 ↓ 0.0 0 1

Nested Loop (cost=0.31..8.35 rows=1 width=8) (actual time=0.002..0.002 rows=0 loops=1)

17. 0.002 0.003 ↓ 0.0 0 1

HashAggregate (cost=0.02..0.03 rows=1 width=4) (actual time=0.002..0.003 rows=0 loops=1)

  • Group Key: calendar_items_2.owner_id
18. 0.001 0.001 ↓ 0.0 0 1

CTE Scan on calendar_items calendar_items_2 (cost=0.00..0.02 rows=1 width=4) (actual time=0.001..0.001 rows=0 loops=1)

  • Filter: ((owner_type)::text = 'invite'::text)
  • Rows Removed by Filter: 1
19. 0.000 0.000 ↓ 0.0 0

Index Scan using invites_pkey on invites (cost=0.29..8.30 rows=1 width=8) (never executed)

  • Index Cond: (id = calendar_items_2.owner_id)
20. 0.000 0.000 ↓ 0.0 0

Index Scan using index_requisitions_on_id_and_deleted on requisitions (cost=0.14..0.16 rows=1 width=29) (never executed)

  • Index Cond: (id = invites.requisition_id)
21.          

CTE requisition_json

22. 0.003 0.003 ↓ 0.0 0 1

CTE Scan on requisition_attributes (cost=0.00..0.02 rows=1 width=36) (actual time=0.003..0.003 rows=0 loops=1)

23.          

CTE nested_calendar_items

24. 0.000 0.800 ↑ 1.0 1 1

Nested Loop Left Join (cost=0.00..0.09 rows=1 width=1,640) (actual time=0.799..0.800 rows=1 loops=1)

  • Join Filter: (((calendar_items_3.owner_type)::text = 'invite'::text) AND (calendar_items_3.owner_id = requisition_json.invite_id))
25. 0.004 0.797 ↑ 1.0 1 1

Nested Loop (cost=0.00..0.05 rows=1 width=1,608) (actual time=0.795..0.797 rows=1 loops=1)

  • Join Filter: (calendar_items_3.id = calendar_item_participant_json.calendar_item_id)
26. 0.640 0.640 ↑ 1.0 1 1

CTE Scan on calendar_items calendar_items_3 (cost=0.00..0.02 rows=1 width=1,576) (actual time=0.640..0.640 rows=1 loops=1)

27. 0.153 0.153 ↑ 1.0 1 1

CTE Scan on calendar_item_participant_json (cost=0.00..0.02 rows=1 width=36) (actual time=0.152..0.153 rows=1 loops=1)

28. 0.003 0.003 ↓ 0.0 0 1

CTE Scan on requisition_json (cost=0.00..0.02 rows=1 width=36) (actual time=0.003..0.003 rows=0 loops=1)

29. 0.808 0.808 ↑ 1.0 1 1

CTE Scan on nested_calendar_items (cost=0.00..0.02 rows=1 width=24) (actual time=0.807..0.808 rows=1 loops=1)