explain.depesz.com

PostgreSQL's explain analyze made readable

Result: wcRb

Settings
# exclusive inclusive rows x rows loops node
1. 0.158 18.155 ↓ 8.0 8 1

GroupAggregate (cost=7,217.08..7,217.33 rows=1 width=964) (actual time=18.048..18.155 rows=8 loops=1)

  • Group Key: hb.id
2. 0.029 17.997 ↓ 17.0 17 1

Sort (cost=7,217.08..7,217.08 rows=1 width=426) (actual time=17.994..17.997 rows=17 loops=1)

  • Sort Key: hb.id
  • Sort Method: quicksort Memory: 33kB
3. 0.011 17.968 ↓ 17.0 17 1

Nested Loop Left Join (cost=233.04..7,217.07 rows=1 width=426) (actual time=5.728..17.968 rows=17 loops=1)

4. 0.008 17.957 ↓ 17.0 17 1

Nested Loop Left Join (cost=232.77..7,210.48 rows=1 width=441) (actual time=5.726..17.957 rows=17 loops=1)

5. 0.042 17.949 ↓ 17.0 17 1

Nested Loop Left Join (cost=232.50..7,203.90 rows=1 width=456) (actual time=5.725..17.949 rows=17 loops=1)

  • Join Filter: (hb.id = e.itinerary_id)
  • Rows Removed by Join Filter: 119
6. 0.000 17.890 ↓ 17.0 17 1

Nested Loop Left Join (cost=232.50..7,202.74 rows=1 width=362) (actual time=5.715..17.890 rows=17 loops=1)

7. 0.008 17.841 ↓ 17.0 17 1

Nested Loop Left Join (cost=232.08..7,197.69 rows=1 width=354) (actual time=5.707..17.841 rows=17 loops=1)

8. 0.008 17.793 ↓ 8.0 8 1

Nested Loop (cost=231.65..7,181.00 rows=1 width=348) (actual time=5.697..17.793 rows=8 loops=1)

  • Join Filter: (hb.id = hbt.itinerary_id)
9. 0.012 17.737 ↓ 8.0 8 1

Nested Loop (cost=231.22..7,175.71 rows=1 width=341) (actual time=5.681..17.737 rows=8 loops=1)

10. 0.010 17.685 ↓ 8.0 8 1

Nested Loop (cost=230.79..7,169.02 rows=1 width=143) (actual time=5.665..17.685 rows=8 loops=1)

11. 0.069 0.930 ↑ 2.0 1 1

Hash Join (cost=207.76..226.23 rows=2 width=47) (actual time=0.832..0.930 rows=1 loops=1)

  • Hash Cond: ((c.id)::text = (h.country_id)::text)
12. 0.065 0.065 ↑ 1.0 459 1

Seq Scan on countries c (cost=0.00..15.59 rows=459 width=27) (actual time=0.007..0.065 rows=459 loops=1)

13. 0.002 0.796 ↑ 3.0 1 1

Hash (cost=207.72..207.72 rows=3 width=62) (actual time=0.796..0.796 rows=1 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
14. 0.012 0.794 ↑ 3.0 1 1

Bitmap Heap Scan on hotels h (cost=196.02..207.72 rows=3 width=62) (actual time=0.793..0.794 rows=1 loops=1)

  • Recheck Cond: ((name)::text ~~* '%The Papandayan%'::text)
  • Heap Blocks: exact=1
15. 0.782 0.782 ↑ 3.0 1 1

Bitmap Index Scan on idx_trigram_hotel (cost=0.00..196.02 rows=3 width=0) (actual time=0.782..0.782 rows=1 loops=1)

  • Index Cond: ((name)::text ~~* '%The Papandayan%'::text)
16. 15.514 16.745 ↓ 4.0 8 1

Bitmap Heap Scan on hotel_bookings hb (cost=23.03..3,471.37 rows=2 width=104) (actual time=4.827..16.745 rows=8 loops=1)

  • Recheck Cond: (hotel_id = h.id)
  • Filter: (((booking_status)::text = 'issued'::text) AND (date(created_date) >= '2020-09-02'::date) AND (date(created_date) <= '2020-09-02'::date))
  • Rows Removed by Filter: 9,403
  • Heap Blocks: exact=10,130
17. 1.231 1.231 ↓ 12.3 10,864 1

Bitmap Index Scan on hotel_bookings_hotel_id_idx (cost=0.00..23.03 rows=880 width=0) (actual time=1.231..1.231 rows=10,864 loops=1)

  • Index Cond: (hotel_id = h.id)
18. 0.040 0.040 ↑ 1.0 1 8

Index Scan using hotel_payments_itinerary_id_unique on hotel_payments hp (cost=0.43..6.69 rows=1 width=198) (actual time=0.005..0.005 rows=1 loops=8)

  • Index Cond: (itinerary_id = hb.id)
  • Filter: (((payment_method)::text = 'BANK_TRANSFER'::text) AND ((payment_status)::text = 'PENDING'::text))
19. 0.048 0.048 ↑ 1.0 1 8

Index Scan using hotel_booking_traveller_hotel_booking_id_unique on hotel_booking_travellers hbt (cost=0.43..5.28 rows=1 width=23) (actual time=0.005..0.006 rows=1 loops=8)

  • Index Cond: (itinerary_id = hp.itinerary_id)
20. 0.040 0.040 ↑ 3.5 2 8

Index Scan using hotel_booking_detail_hotel_booking_id_checkin_date_unique on hotel_booking_details hbd (cost=0.43..16.62 rows=7 width=14) (actual time=0.004..0.005 rows=2 loops=8)

  • Index Cond: (hb.id = itinerary_id)
21. 0.051 0.051 ↓ 0.0 0 17

Index Scan using hotel_softblock_itenary_id_idx on hotel_softblock_transactions hst (cost=0.42..5.04 rows=1 width=16) (actual time=0.003..0.003 rows=0 loops=17)

  • Index Cond: (itinerary_id = hb.id)
22. 0.017 0.017 ↑ 1.0 7 17

Seq Scan on hotel_booking_entities e (cost=0.00..1.07 rows=7 width=102) (actual time=0.001..0.001 rows=7 loops=17)

23. 0.000 0.000 ↓ 0.0 0 17

Index Scan using country_id_pk on countries cc (cost=0.27..6.58 rows=1 width=27) (actual time=0.000..0.000 rows=0 loops=17)

  • Index Cond: ((e.country_id)::text = (id)::text)
24. 0.000 0.000 ↓ 0.0 0 17

Index Scan using country_id_pk on countries cp (cost=0.27..6.58 rows=1 width=27) (actual time=0.000..0.000 rows=0 loops=17)

  • Index Cond: ((e.country_pair_id)::text = (id)::text)
Planning time : 3.189 ms
Execution time : 18.466 ms