explain.depesz.com

PostgreSQL's explain analyze made readable

Result: PQPK

Settings
# exclusive inclusive rows x rows loops node
1. 0.040 0.496 ↓ 12.0 12 1

Nested Loop Left Join (cost=2.45..93.27 rows=1 width=265) (actual time=0.226..0.496 rows=12 loops=1)

2. 0.014 0.432 ↓ 12.0 12 1

Nested Loop Left Join (cost=2.30..93.09 rows=1 width=289) (actual time=0.203..0.432 rows=12 loops=1)

3. 0.017 0.370 ↓ 12.0 12 1

Nested Loop Left Join (cost=2.16..92.93 rows=1 width=302) (actual time=0.173..0.370 rows=12 loops=1)

4. 0.017 0.293 ↓ 12.0 12 1

Nested Loop (cost=2.02..92.76 rows=1 width=294) (actual time=0.123..0.293 rows=12 loops=1)

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

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

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

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

7. 0.003 0.097 ↑ 1.8 4 1

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

8. 0.006 0.056 ↑ 1.0 2 1

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

9. 0.030 0.030 ↑ 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.026..0.030 rows=2 loops=1)

  • Index Cond: (hotel_id = ANY ('{38,45}'::bigint[]))
10. 0.020 0.020 ↑ 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.010..0.010 rows=1 loops=2)

  • Index Cond: (id = hc.hotel_id)
  • Filter: ((NOT is_deleted) AND (active_status = 2))
11. 0.038 0.038 ↑ 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.012..0.019 rows=2 loops=2)

  • Index Cond: (hotel_id = h.id)
  • Filter: ((NOT is_deleted) AND is_active)
  • Rows Removed by Filter: 12
12. 0.044 0.044 ↓ 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.009..0.011 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.060 0.060 ↑ 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.005..0.005 rows=1 loops=12)

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

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

  • Index Cond: (id = rr.rate_plan_id)
  • Filter: (is_active AND (NOT is_deleted))
15. 0.060 0.060 ↑ 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.005..0.005 rows=1 loops=12)

  • Index Cond: (h.id = hotel_id)
  • Filter: (is_active AND (NOT is_deleted))
16. 0.048 0.048 ↑ 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.004..0.004 rows=1 loops=12)

  • Index Cond: ((h.country_id)::text = (id)::text)
  • Filter: (NOT is_deleted)
17. 0.024 0.024 ↑ 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.002..0.002 rows=1 loops=12)

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