explain.depesz.com

PostgreSQL's explain analyze made readable

Result: EEtU

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=20.72..63.53 rows=1 width=2,940) (actual rows= loops=)

  • -> Index Scan using country_id_pk on countries cp (cost=0.14..1.12 rows=1 width=196)" Index Cond: ((e.country_pair_id)::text = (id)::text)
2.          

CTE hb

3. 0.000 0.000 ↓ 0.0

Seq Scan on hotel_bookings hb_3 (cost=0.00..3.18 rows=1 width=2,204) (actual rows= loops=)

  • Filter: (((booking_status)::text = 'issued'::text) AND (date(created_date) >= '2020-09-02'::date) AND (date(created_date) <= '2020-09-02'::date))
4. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=17.39..59.21 rows=1 width=2,832) (actual rows= loops=)

5. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=17.25..58.07 rows=1 width=2,792) (actual rows= loops=)

  • Join Filter: (hst.itinerary_id = hb.id)
6. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=9.05..49.83 rows=1 width=2,792) (actual rows= loops=)

7. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=8.91..41.66 rows=1 width=2,064) (actual rows= loops=)

  • Join Filter: (hbd.itinerary_id = hp.itinerary_id)
8. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.71..33.40 rows=1 width=2,032) (actual rows= loops=)

9. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.56..25.11 rows=1 width=1,939) (actual rows= loops=)

10. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.28..8.78 rows=1 width=1,890) (actual rows= loops=)

  • Join Filter: (hb.id = hp.itinerary_id)
11. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.14..8.30 rows=1 width=648) (actual rows= loops=)

12. 0.000 0.000 ↓ 0.0

CTE Scan on hb (cost=0.00..0.02 rows=1 width=576) (actual rows= loops=)

13. 0.000 0.000 ↓ 0.0

Index Scan using hotel_booking_traveller_hotel_booking_id_unique on hotel_booking_travellers hbt (cost=0.14..8.16 rows=1 width=72) (actual rows= loops=)

  • Index Cond: (itinerary_id = hb.id)
14. 0.000 0.000 ↓ 0.0

Index Scan using hotel_payments_itinerary_id_unique on hotel_payments hp (cost=0.14..0.47 rows=1 width=1,250) (actual rows= loops=)

  • Index Cond: (itinerary_id = hbt.itinerary_id)
  • Filter: (((payment_method)::text = 'BANK_TRANSFER'::text) AND ((payment_status)::text = 'PENDING'::text))
15. 0.000 0.000 ↓ 0.0

Index Scan using hotel_id_pk on hotels h (cost=0.28..8.30 rows=1 width=57) (actual rows= loops=)

  • Index Cond: (id = hb.hotel_id)
  • Filter: ((name)::text ~~* '%The Papandayan%'::text)
16. 0.000 0.000 ↓ 0.0

Index Scan using country_id_pk on countries c (cost=0.14..8.16 rows=1 width=196) (actual rows= loops=)

  • Index Cond: ((id)::text = (h.country_id)::text)
17. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=8.20..8.24 rows=1 width=40) (actual rows= loops=)

  • Group Key: hbd.itinerary_id
18. 0.000 0.000 ↓ 0.0

Sort (cost=8.20..8.21 rows=1 width=41) (actual rows= loops=)

  • Sort Key: hbd.itinerary_id
19. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.14..8.19 rows=1 width=41) (actual rows= loops=)

20. 0.000 0.000 ↓ 0.0

CTE Scan on hb hb_1 (cost=0.00..0.02 rows=1 width=25) (actual rows= loops=)

21. 0.000 0.000 ↓ 0.0

Index Scan using hotel_booking_detail_hotel_booking_id_checkin_date_unique on hotel_booking_details hbd (cost=0.14..8.16 rows=1 width=24) (actual rows= loops=)

  • Index Cond: (itinerary_id = hb_1.id)
22. 0.000 0.000 ↓ 0.0

Index Scan using hotel_booking_entities_itinerary_id_idx on hotel_booking_entities e (cost=0.14..8.16 rows=1 width=736) (actual rows= loops=)

  • Index Cond: (hb.id = itinerary_id)
23. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=8.20..8.22 rows=1 width=16) (actual rows= loops=)

  • Group Key: hst.itinerary_id
24. 0.000 0.000 ↓ 0.0

Sort (cost=8.20..8.21 rows=1 width=16) (actual rows= loops=)

  • Sort Key: hst.itinerary_id
25. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.14..8.19 rows=1 width=16) (actual rows= loops=)

26. 0.000 0.000 ↓ 0.0

CTE Scan on hb hb_2 (cost=0.00..0.02 rows=1 width=8) (actual rows= loops=)

27. 0.000 0.000 ↓ 0.0

Index Scan using hotel_softblock_itenary_id_idx on hotel_softblock_transactions hst (cost=0.14..8.16 rows=1 width=16) (actual rows= loops=)

  • Index Cond: (itinerary_id = hb_2.id)
28. 0.000 0.000 ↓ 0.0

Index Scan using country_id_pk on countries cc (cost=0.14..1.12 rows=1 width=196) (actual rows= loops=)

  • Index Cond: ((e.country_id)::text = (id)::text)