explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 8N6D

Settings
# exclusive inclusive rows x rows loops node
1. 791.917 65,745.622 ↓ 1.0 10,000 1

Hash Left Join (cost=68.25..8,770,020.43 rows=9,977 width=176) (actual time=97.876..65,745.622 rows=10,000 loops=1)

  • Hash Cond: ((main_session.session_type_code)::text = (st.code)::text)
2. 220.088 640.937 ↓ 1.0 10,000 1

Hash Left Join (cost=64.00..398.37 rows=9,977 width=109) (actual time=77.139..640.937 rows=10,000 loops=1)

  • Hash Cond: (main_session.room_id = r.id)
3. 225.781 385.193 ↓ 1.0 10,000 1

Hash Left Join (cost=32.50..340.57 rows=9,977 width=101) (actual time=41.349..385.193 rows=10,000 loops=1)

  • Hash Cond: (main_session.person_id = p.id)
4. 118.353 118.353 ↓ 1.0 10,000 1

Seq Scan on session main_session (cost=0.00..281.77 rows=9,977 width=92) (actual time=0.073..118.353 rows=10,000 loops=1)

5. 22.585 41.059 ↑ 1.0 1,000 1

Hash (cost=20.00..20.00 rows=1,000 width=25) (actual time=41.052..41.059 rows=1,000 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 65kB
6. 18.474 18.474 ↑ 1.0 1,000 1

Seq Scan on person p (cost=0.00..20.00 rows=1,000 width=25) (actual time=0.023..18.474 rows=1,000 loops=1)

7. 17.261 35.656 ↑ 1.0 1,000 1

Hash (cost=19.00..19.00 rows=1,000 width=24) (actual time=35.649..35.656 rows=1,000 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 64kB
8. 18.395 18.395 ↑ 1.0 1,000 1

Seq Scan on room r (cost=0.00..19.00 rows=1,000 width=24) (actual time=0.102..18.395 rows=1,000 loops=1)

9. 1.269 2.768 ↑ 1.0 100 1

Hash (cost=3.00..3.00 rows=100 width=39) (actual time=2.761..2.768 rows=100 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 16kB
10. 1.499 1.499 ↑ 1.0 100 1

Seq Scan on session_type st (cost=0.00..3.00 rows=100 width=39) (actual time=0.044..1.499 rows=100 loops=1)

11.          

SubPlan (forHash Left Join)

12. 610.000 30,590.000 ↑ 1.0 1 10,000

Aggregate (cost=430.65..430.66 rows=1 width=8) (actual time=3.046..3.059 rows=1 loops=10,000)

13. 29,980.000 29,980.000 ↑ 1.0 1 10,000

Seq Scan on hearing_part (cost=0.00..430.65 rows=1 width=16) (actual time=1.745..2.998 rows=1 loops=10,000)

  • Filter: ((NOT is_deleted) AND (session_id = main_session.id))
  • Rows Removed by Filter: 15170
14. 470.000 33,720.000 ↑ 1.0 1 10,000

Aggregate (cost=448.30..448.31 rows=1 width=32) (actual time=3.362..3.372 rows=1 loops=10,000)

15. 625.200 33,250.000 ↓ 0.0 0 10,000

Nested Loop (cost=0.57..448.30 rows=1 width=17) (actual time=2.961..3.325 rows=0 loops=10,000)

  • Join Filter: ((hearing_part_1.status)::text = (sc.status)::text)
  • Rows Removed by Join Filter: 1
16. 662.160 32,340.000 ↑ 1.0 1 10,000

Nested Loop Left Join (cost=0.57..447.27 rows=1 width=25) (actual time=1.855..3.234 rows=1 loops=10,000)

17. 925.712 31,450.000 ↑ 1.0 1 10,000

Nested Loop (cost=0.29..438.96 rows=1 width=32) (actual time=1.805..3.145 rows=1 loops=10,000)

18. 30,080.000 30,080.000 ↑ 1.0 1 10,000

Seq Scan on hearing_part hearing_part_1 (cost=0.00..430.65 rows=1 width=40) (actual time=1.743..3.008 rows=1 loops=10,000)

  • Filter: ((NOT is_deleted) AND (session_id = main_session.id))
  • Rows Removed by Filter: 15170
19. 444.288 444.288 ↑ 1.0 1 11,392

Index Scan using session_pkey on session s (cost=0.29..8.30 rows=1 width=24) (actual time=0.024..0.039 rows=1 loops=11,392)

  • Index Cond: (id = main_session.id)
20. 227.840 227.840 ↑ 1.0 1 11,392

Index Scan using hearing_pkey on hearing h (cost=0.28..8.30 rows=1 width=25) (actual time=0.020..0.020 rows=1 loops=11,392)

  • Index Cond: (hearing_part_1.hearing_id = id)
21. 284.800 284.800 ↑ 1.0 1 11,392

Seq Scan on status_config sc (cost=0.00..1.02 rows=1 width=78) (actual time=0.015..0.025 rows=1 loops=11,392)

  • Filter: count_in_utilization
  • Rows Removed by Filter: 3