explain.depesz.com

PostgreSQL's explain analyze made readable

Result: V3NU

Settings
# exclusive inclusive rows x rows loops node
1. 0.088 2.729 ↓ 12.0 12 1

Nested Loop Left Join (cost=2.45..93.26 rows=1 width=768) (actual time=1.289..2.729 rows=12 loops=1)

2. 0.043 2.437 ↓ 12.0 12 1

Nested Loop Left Join (cost=2.30..93.09 rows=1 width=569) (actual time=1.118..2.437 rows=12 loops=1)

3. 0.044 2.286 ↓ 12.0 12 1

Nested Loop Left Join (cost=2.16..92.93 rows=1 width=582) (actual time=1.059..2.286 rows=12 loops=1)

4. 0.056 2.158 ↓ 12.0 12 1

Nested Loop (cost=2.02..92.76 rows=1 width=574) (actual time=1.030..2.158 rows=12 loops=1)

  • Join Filter: (r.id = ANY (rp.room_ids))
5. 0.055 1.142 ↓ 12.0 12 1

Nested Loop (cost=1.73..92.43 rows=1 width=263) (actual time=0.252..1.142 rows=12 loops=1)

  • Join Filter: (r.id = rr.room_id)
6. 0.024 0.691 ↓ 6.0 12 1

Nested Loop (cost=1.30..77.16 rows=2 width=242) (actual time=0.189..0.691 rows=12 loops=1)

7. 0.009 0.299 ↑ 1.8 4 1

Nested Loop (cost=0.86..31.33 rows=7 width=210) (actual time=0.094..0.299 rows=4 loops=1)

8. 0.011 0.108 ↑ 1.0 2 1

Nested Loop (cost=0.57..29.26 rows=2 width=94) (actual time=0.028..0.108 rows=2 loops=1)

9. 0.021 0.021 ↑ 1.0 2 1

Index Scan using hotel_comissions_hotel_id_idx on hotel_commissions hc (cost=0.29..12.64 rows=2 width=16) (actual time=0.009..0.021 rows=2 loops=1)

  • Index Cond: (hotel_id = ANY ('{38,45}'::bigint[]))
10. 0.076 0.076 ↑ 1.0 1 2

Index Scan using hotel_id_pk on hotels h (cost=0.29..8.30 rows=1 width=78) (actual time=0.038..0.038 rows=1 loops=2)

  • Index Cond: (id = hc.hotel_id)
  • Filter: ((NOT is_deleted) AND (active_status = 2))
11. 0.182 0.182 ↑ 2.0 2 2

Index Scan using rooms_hotel_id_idx on rooms r (cost=0.29..1.00 rows=4 width=132) (actual time=0.051..0.091 rows=2 loops=2)

  • Index Cond: (hotel_id = h.id)
  • Filter: ((NOT is_deleted) AND is_active)
  • Rows Removed by Filter: 12
12. 0.368 0.368 ↓ 3.0 3 4

Index Scan using allotment_room_id_date_unique on room_allotments ra (cost=0.43..6.54 rows=1 width=32) (actual time=0.079..0.092 rows=3 loops=4)

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

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.032..0.033 rows=1 loops=12)

  • Index Cond: ((room_id = ra.room_id) AND (date = ra.date))
  • Filter: (NOT is_deleted)
14. 0.960 0.960 ↑ 1.0 1 12

Index Scan using rate_plan_id_pk on rate_plans rp (cost=0.29..0.31 rows=1 width=344) (actual time=0.080..0.080 rows=1 loops=12)

  • Index Cond: (id = rr.rate_plan_id)
  • Filter: (is_active AND (NOT is_deleted))
15. 0.084 0.084 ↑ 1.0 1 12

Index Scan using hotel_softblocks_hotel_id_start_period_end_period_index on hotel_softblocks hs (cost=0.14..0.17 rows=1 width=16) (actual time=0.007..0.007 rows=1 loops=12)

  • Index Cond: (h.id = hotel_id)
  • Filter: (is_active AND (NOT is_deleted))
16. 0.108 0.108 ↑ 1.0 1 12

Index Scan using country_id_pk on countries c (cost=0.14..0.17 rows=1 width=90) (actual time=0.009..0.009 rows=1 loops=12)

  • Index Cond: ((h.country_id)::text = (id)::text)
  • Filter: (NOT is_deleted)
17. 0.204 0.204 ↑ 1.0 1 12

Index Scan using region_id_pk on regions rg (cost=0.14..0.17 rows=1 width=90) (actual time=0.017..0.017 rows=1 loops=12)

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