explain.depesz.com

PostgreSQL's explain analyze made readable

Result: xD4g

Settings
# exclusive inclusive rows x rows loops node
1. 0.195 21.748 ↓ 8.0 8 1

GroupAggregate (cost=7,281.10..7,281.35 rows=1 width=964) (actual time=21.622..21.748 rows=8 loops=1)

  • Group Key: hb.id
2. 0.061 21.553 ↓ 17.0 17 1

Sort (cost=7,281.10..7,281.11 rows=1 width=426) (actual time=21.551..21.553 rows=17 loops=1)

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

Nested Loop Left Join (cost=297.04..7,281.09 rows=1 width=426) (actual time=7.134..21.492 rows=17 loops=1)

4. 0.014 21.474 ↓ 17.0 17 1

Nested Loop Left Join (cost=296.77..7,274.51 rows=1 width=441) (actual time=7.132..21.474 rows=17 loops=1)

5. 0.059 21.460 ↓ 17.0 17 1

Nested Loop Left Join (cost=296.50..7,267.92 rows=1 width=456) (actual time=7.128..21.460 rows=17 loops=1)

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

Nested Loop Left Join (cost=296.50..7,266.77 rows=1 width=362) (actual time=7.115..21.384 rows=17 loops=1)

7. 0.015 21.322 ↓ 17.0 17 1

Nested Loop Left Join (cost=296.08..7,261.72 rows=1 width=354) (actual time=7.090..21.322 rows=17 loops=1)

8. 0.016 21.259 ↓ 8.0 8 1

Nested Loop (cost=295.65..7,245.03 rows=1 width=348) (actual time=7.078..21.259 rows=8 loops=1)

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

Nested Loop (cost=295.22..7,239.74 rows=1 width=341) (actual time=7.060..21.195 rows=8 loops=1)

10. 0.014 21.127 ↓ 8.0 8 1

Nested Loop (cost=294.79..7,233.04 rows=1 width=143) (actual time=7.035..21.127 rows=8 loops=1)

11. 0.072 1.372 ↑ 2.0 1 1

Hash Join (cost=271.76..290.23 rows=2 width=47) (actual time=1.244..1.372 rows=1 loops=1)

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

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

13. 0.003 1.204 ↑ 3.0 1 1

Hash (cost=271.72..271.72 rows=3 width=62) (actual time=1.204..1.204 rows=1 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
14. 0.015 1.201 ↑ 3.0 1 1

Bitmap Heap Scan on hotels h (cost=260.02..271.72 rows=3 width=62) (actual time=1.200..1.201 rows=1 loops=1)

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

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

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

Bitmap Heap Scan on hotel_bookings hb (cost=23.03..3,471.38 rows=2 width=104) (actual time=5.783..19.741 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,404
  • Heap Blocks: exact=10,131
17. 1.510 1.510 ↓ 12.3 10,865 1

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

  • Index Cond: (hotel_id = h.id)
18. 0.056 0.056 ↑ 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.007..0.007 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.048 0.048 ↑ 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.005..0.006 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.732 ms
Execution time : 22.183 ms