explain.depesz.com

PostgreSQL's explain analyze made readable

Result: NJmt

Settings
# exclusive inclusive rows x rows loops node
1. 0.053 0.606 ↓ 9.0 9 1

Sort (cost=144.86..144.86 rows=1 width=747) (actual time=0.605..0.606 rows=9 loops=1)

  • Sort Key: r.id, rp.id, rr.date
  • Sort Method: quicksort Memory: 28kB
2. 0.017 0.553 ↓ 9.0 9 1

Nested Loop Left Join (cost=3.71..144.85 rows=1 width=747) (actual time=0.223..0.553 rows=9 loops=1)

3. 0.017 0.509 ↓ 9.0 9 1

Nested Loop Left Join (cost=3.56..136.42 rows=1 width=836) (actual time=0.204..0.509 rows=9 loops=1)

4. 0.010 0.465 ↓ 9.0 9 1

Nested Loop Left Join (cost=3.42..128.00 rows=1 width=849) (actual time=0.187..0.465 rows=9 loops=1)

  • Join Filter: (hai.hotel_id = h.id)
5. 0.010 0.428 ↓ 9.0 9 1

Nested Loop Left Join (cost=2.73..103.13 rows=1 width=785) (actual time=0.170..0.428 rows=9 loops=1)

6. 0.005 0.409 ↓ 9.0 9 1

Nested Loop Left Join (cost=2.45..94.81 rows=1 width=785) (actual time=0.160..0.409 rows=9 loops=1)

  • Join Filter: (ha.hotel_id = h.id)
7. 0.012 0.368 ↓ 9.0 9 1

Nested Loop Left Join (cost=2.31..86.63 rows=1 width=769) (actual time=0.144..0.368 rows=9 loops=1)

  • Join Filter: (hs.hotel_id = h.id)
8. 0.010 0.329 ↓ 9.0 9 1

Nested Loop Left Join (cost=2.16..78.45 rows=1 width=761) (actual time=0.127..0.329 rows=9 loops=1)

9. 0.011 0.301 ↓ 9.0 9 1

Nested Loop (cost=2.02..72.21 rows=1 width=543) (actual time=0.117..0.301 rows=9 loops=1)

  • Join Filter: (r.id = ANY (rp.room_ids))
10. 0.011 0.245 ↓ 9.0 9 1

Nested Loop (cost=1.73..71.88 rows=1 width=420) (actual time=0.098..0.245 rows=9 loops=1)

  • Join Filter: (r.id = rr.room_id)
11. 0.005 0.180 ↓ 9.0 9 1

Nested Loop (cost=1.29..64.25 rows=1 width=399) (actual time=0.079..0.180 rows=9 loops=1)

12. 0.010 0.139 ↓ 9.0 9 1

Nested Loop (cost=1.01..55.94 rows=1 width=391) (actual time=0.064..0.139 rows=9 loops=1)

13. 0.007 0.084 ↓ 9.0 9 1

Nested Loop (cost=0.72..47.62 rows=1 width=216) (actual time=0.046..0.084 rows=9 loops=1)

14. 0.038 0.038 ↑ 1.3 3 1

Index Scan using rooms_hotel_id_idx on rooms r (cost=0.29..13.75 rows=4 width=186) (actual time=0.025..0.038 rows=3 loops=1)

  • Index Cond: (hotel_id = 38)
  • Filter: ((NOT is_deleted) AND is_active)
  • Rows Removed by Filter: 16
15. 0.039 0.039 ↓ 3.0 3 3

Index Scan using room_allotments_room_id_date_idx on room_allotments ra (cost=0.43..8.46 rows=1 width=30) (actual time=0.010..0.013 rows=3 loops=3)

  • Index Cond: ((room_id = r.id) AND (date >= '2020-11-13'::date) AND (date <= '2020-11-15'::date))
  • Filter: (NOT is_deleted)
16. 0.045 0.045 ↑ 1.0 1 9

Index Scan using hotel_id_pk on hotels h (cost=0.29..8.30 rows=1 width=183) (actual time=0.005..0.005 rows=1 loops=9)

  • Index Cond: (id = 38)
  • Filter: ((NOT is_deleted) AND (active_status = 2))
17. 0.036 0.036 ↑ 1.0 1 9

Index Scan using hotel_comissions_hotel_id_idx on hotel_commissions hc (cost=0.29..8.30 rows=1 width=16) (actual time=0.003..0.004 rows=1 loops=9)

  • Index Cond: (hotel_id = 38)
18. 0.054 0.054 ↑ 1.0 1 9

Index Scan using room_rates_room_id_date_idx on room_rates rr (cost=0.43..7.62 rows=1 width=41) (actual time=0.005..0.006 rows=1 loops=9)

  • Index Cond: ((room_id = ra.room_id) AND (date = ra.date))
  • Filter: (NOT is_deleted)
19. 0.045 0.045 ↑ 1.0 1 9

Index Scan using rate_plan_id_pk on rate_plans rp (cost=0.29..0.31 rows=1 width=156) (actual time=0.005..0.005 rows=1 loops=9)

  • Index Cond: (id = rr.rate_plan_id)
  • Filter: (is_active AND (NOT is_deleted))
20. 0.018 0.018 ↓ 0.0 0 9

Index Scan using mst_room_types_id_pk on mst_room_types mrt (cost=0.14..6.16 rows=1 width=222) (actual time=0.002..0.002 rows=0 loops=9)

  • Index Cond: (id = r.room_type_id)
21. 0.027 0.027 ↑ 1.0 1 9

Index Scan using hotel_softblocks_hotel_id_start_period_end_period_index on hotel_softblocks hs (cost=0.14..8.16 rows=1 width=8) (actual time=0.003..0.003 rows=1 loops=9)

  • Index Cond: (hotel_id = 38)
  • Filter: (is_active AND (NOT is_deleted))
22. 0.036 0.036 ↓ 0.0 0 9

Index Scan using announcement_hotel_id_unique on hotel_announcements ha (cost=0.14..8.17 rows=1 width=24) (actual time=0.004..0.004 rows=0 loops=9)

  • Index Cond: (hotel_id = 38)
  • Filter: (is_active AND (start_date <= '2020-11-13'::date) AND (end_date >= '2020-11-14'::date))
  • Rows Removed by Filter: 1
23. 0.009 0.009 ↓ 0.0 0 9

Index Scan using translation_uuid_unique on translations t (cost=0.28..8.29 rows=1 width=32) (actual time=0.001..0.001 rows=0 loops=9)

  • Index Cond: ((uuid = ha.description_i18n_uuid) AND ((language)::text = 'en'::text))
  • Filter: (NOT is_deleted)
24. 0.009 0.027 ↓ 0.0 0 9

GroupAggregate (cost=0.70..24.84 rows=1 width=72) (actual time=0.003..0.003 rows=0 loops=9)

  • Group Key: hai.hotel_id
25. 0.000 0.018 ↓ 0.0 0 9

Nested Loop Left Join (cost=0.70..24.82 rows=1 width=40) (actual time=0.002..0.002 rows=0 loops=9)

26. 0.000 0.018 ↓ 0.0 0 9

Nested Loop Left Join (cost=0.42..16.49 rows=1 width=40) (actual time=0.002..0.002 rows=0 loops=9)

27. 0.018 0.018 ↓ 0.0 0 9

Index Scan using hotel_additional_instructions_hotel_id_idx on hotel_additional_instructions hai (cost=0.14..8.16 rows=1 width=40) (actual time=0.002..0.002 rows=0 loops=9)

  • Index Cond: (hotel_id = 38)
28. 0.000 0.000 ↓ 0.0 0

Index Scan using translation_uuid_unique on translations tr (cost=0.28..8.29 rows=1 width=32) (never executed)

  • Index Cond: ((uuid = hai.title_i18n_uuid) AND ((language)::text = 'en'::text))
  • Filter: (NOT is_deleted)
29. 0.000 0.000 ↓ 0.0 0

Index Scan using translation_uuid_unique on translations tr2 (cost=0.28..8.29 rows=1 width=32) (never executed)

  • Index Cond: ((uuid = hai.description_i18n_uuid) AND ((language)::text = 'en'::text))
  • Filter: (NOT is_deleted)
30. 0.027 0.027 ↑ 1.0 1 9

Index Scan using country_id_pk on countries c (cost=0.14..8.16 rows=1 width=90) (actual time=0.003..0.003 rows=1 loops=9)

  • Index Cond: ((h.country_id)::text = (id)::text)
  • Filter: (NOT is_deleted)
31. 0.027 0.027 ↑ 1.0 1 9

Index Scan using region_id_pk on regions rg (cost=0.14..8.16 rows=1 width=90) (actual time=0.003..0.003 rows=1 loops=9)

  • Index Cond: ((h.region_id)::text = (id)::text)
  • Filter: (NOT is_deleted)
Planning time : 12.315 ms
Execution time : 0.937 ms