explain.depesz.com

PostgreSQL's explain analyze made readable

Result: iBag

Settings
# exclusive inclusive rows x rows loops node
1. 0.097 17,714.107 ↓ 14.5 1,000 1

Limit (cost=2,274,596.69..3,984,548.50 rows=69 width=526) (actual time=17,651.910..17,714.107 rows=1,000 loops=1)

2.          

CTE cte

3. 12.321 12.321 ↑ 320.2 34,445 1

Seq Scan on dynamo_request d_1 (cost=0.00..666,685.47 rows=11,030,549 width=133) (actual time=0.014..12.321 rows=34,445 loops=1)

  • Filter: ((legacy_instance)::text = 'LA'::text)
4. 6.156 17,714.010 ↓ 14.5 1,000 1

Nested Loop (cost=1,607,911.22..3,317,863.03 rows=69 width=526) (actual time=17,651.908..17,714.010 rows=1,000 loops=1)

5. 1.115 17,705.854 ↓ 14.5 1,000 1

Nested Loop (cost=1,607,910.80..3,317,826.28 rows=69 width=385) (actual time=17,651.864..17,705.854 rows=1,000 loops=1)

6. 0.365 17,701.739 ↓ 14.5 1,000 1

Nested Loop (cost=1,607,910.37..3,317,794.63 rows=69 width=347) (actual time=17,651.844..17,701.739 rows=1,000 loops=1)

  • Join Filter: (c.calendar_type_id = ct.calendar_type_id)
  • Rows Removed by Join Filter: 3
7. 0.410 17,701.374 ↓ 14.5 1,000 1

Nested Loop (cost=1,607,910.37..3,317,791.87 rows=69 width=342) (actual time=17,651.833..17,701.374 rows=1,000 loops=1)

8. 0.674 17,698.964 ↓ 14.5 1,000 1

Nested Loop (cost=1,607,909.95..3,317,760.70 rows=69 width=338) (actual time=17,651.813..17,698.964 rows=1,000 loops=1)

9. 14.197 17,693.290 ↓ 14.5 1,000 1

Hash Join (cost=1,607,909.38..3,317,677.38 rows=69 width=338) (actual time=17,651.782..17,693.290 rows=1,000 loops=1)

  • Hash Cond: ((d.submission_id = csa.entity_id) AND (d.calendar_id = t.calendar_id))
10. 31.101 31.101 ↑ 320.2 34,445 1

CTE Scan on cte d (cost=0.00..220,610.98 rows=11,030,549 width=322) (actual time=0.017..31.101 rows=34,445 loops=1)

11. 2,523.729 17,647.992 ↓ 1.0 14,831,584 1

Hash (cost=1,313,017.64..1,313,017.64 rows=14,831,449 width=16) (actual time=17,647.992..17,647.992 rows=14,831,584 loops=1)

  • Buckets: 1,048,576 Batches: 32 Memory Usage: 29,887kB
12. 3,810.750 15,124.263 ↓ 1.0 14,831,584 1

Hash Join (cost=28,584.95..1,313,017.64 rows=14,831,449 width=16) (actual time=224.665..15,124.263 rows=14,831,584 loops=1)

  • Hash Cond: (cs.timeframe_id = t.timeframe_id)
13. 4,438.083 11,092.472 ↓ 1.0 14,831,584 1

Merge Join (cost=89.21..1,097,948.12 rows=14,831,449 width=16) (actual time=0.059..11,092.472 rows=14,831,584 loops=1)

  • Merge Cond: (csa.calendar_slot_id = cs.calendar_slot_id)
14. 3,795.684 3,795.684 ↓ 1.0 14,831,584 1

Index Scan using idx_calendar_slot_argument_calendar_slot_1 on calendar_slot_argument csa (cost=0.43..418,067.17 rows=14,831,449 width=12) (actual time=0.034..3,795.684 rows=14,831,584 loops=1)

15. 2,858.705 2,858.705 ↑ 1.0 15,780,655 1

Index Scan using calendar_slot_pkey on calendar_slot cs (cost=0.43..459,329.64 rows=15,781,480 width=8) (actual time=0.022..2,858.705 rows=15,780,655 loops=1)

16. 119.677 221.041 ↑ 1.0 716,474 1

Hash (cost=16,731.55..16,731.55 rows=717,055 width=8) (actual time=221.041..221.041 rows=716,474 loops=1)

  • Buckets: 1,048,576 Batches: 2 Memory Usage: 22,191kB
17. 101.364 101.364 ↑ 1.0 716,474 1

Seq Scan on timeframe t (cost=0.00..16,731.55 rows=717,055 width=8) (actual time=0.005..101.364 rows=716,474 loops=1)

18. 5.000 5.000 ↑ 1.0 1 1,000

Index Scan using submission_pkey on submission s (cost=0.57..1.21 rows=1 width=16) (actual time=0.005..0.005 rows=1 loops=1,000)

  • Index Cond: (submission_id = csa.entity_id)
19. 2.000 2.000 ↑ 1.0 1 1,000

Index Scan using idx_calendar_calendar_project on calendar c (cost=0.42..0.45 rows=1 width=8) (actual time=0.002..0.002 rows=1 loops=1,000)

  • Index Cond: (calendar_id = t.calendar_id)
20. 0.000 0.000 ↑ 2.0 1 1,000

Materialize (cost=0.00..1.03 rows=2 width=13) (actual time=0.000..0.000 rows=1 loops=1,000)

21. 0.006 0.006 ↑ 1.0 2 1

Seq Scan on calendar_type ct (cost=0.00..1.02 rows=2 width=13) (actual time=0.005..0.006 rows=2 loops=1)

22. 3.000 3.000 ↑ 1.0 1 1,000

Index Scan using account_pkey on account a (cost=0.43..0.46 rows=1 width=42) (actual time=0.003..0.003 rows=1 loops=1,000)

  • Index Cond: (account_id = d.account_id)
23. 2.000 2.000 ↑ 1.0 1 1,000

Index Scan using ix_organization_account_account_id on organization_account oa (cost=0.42..0.44 rows=1 width=8) (actual time=0.002..0.002 rows=1 loops=1,000)

  • Index Cond: (account_id = d.created_by)
Planning time : 10.765 ms
Execution time : 17,809.993 ms