explain.depesz.com

PostgreSQL's explain analyze made readable

Result: rbRa

Settings
# exclusive inclusive rows x rows loops node
1. 0.193 20.161 ↓ 8.0 8 1

GroupAggregate (cost=7,285.10..7,285.35 rows=1 width=964) (actual time=20.031..20.161 rows=8 loops=1)

  • Group Key: hb.id
2. 0.038 19.968 ↓ 17.0 17 1

Sort (cost=7,285.10..7,285.11 rows=1 width=426) (actual time=19.965..19.968 rows=17 loops=1)

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

Nested Loop Left Join (cost=301.04..7,285.09 rows=1 width=426) (actual time=6.335..19.930 rows=17 loops=1)

4. 0.009 19.919 ↓ 17.0 17 1

Nested Loop Left Join (cost=300.77..7,278.51 rows=1 width=441) (actual time=6.333..19.919 rows=17 loops=1)

5. 0.049 19.910 ↓ 17.0 17 1

Nested Loop Left Join (cost=300.50..7,271.92 rows=1 width=456) (actual time=6.330..19.910 rows=17 loops=1)

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

Nested Loop Left Join (cost=300.50..7,270.77 rows=1 width=362) (actual time=6.319..19.844 rows=17 loops=1)

7. 0.016 19.808 ↓ 17.0 17 1

Nested Loop Left Join (cost=300.08..7,265.72 rows=1 width=354) (actual time=6.311..19.808 rows=17 loops=1)

8. 0.012 19.736 ↓ 8.0 8 1

Nested Loop (cost=299.65..7,249.03 rows=1 width=348) (actual time=6.299..19.736 rows=8 loops=1)

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

Nested Loop (cost=299.22..7,243.74 rows=1 width=341) (actual time=6.284..19.684 rows=8 loops=1)

10. 0.011 19.626 ↓ 8.0 8 1

Nested Loop (cost=298.79..7,237.04 rows=1 width=143) (actual time=6.267..19.626 rows=8 loops=1)

11. 0.080 1.268 ↑ 2.0 1 1

Hash Join (cost=275.76..294.23 rows=2 width=47) (actual time=1.161..1.268 rows=1 loops=1)

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

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

13. 0.004 1.117 ↑ 3.0 1 1

Hash (cost=275.72..275.72 rows=3 width=62) (actual time=1.117..1.117 rows=1 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
14. 0.013 1.113 ↑ 3.0 1 1

Bitmap Heap Scan on hotels h (cost=264.02..275.72 rows=3 width=62) (actual time=1.112..1.113 rows=1 loops=1)

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

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

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

Bitmap Heap Scan on hotel_bookings hb (cost=23.03..3,471.38 rows=2 width=104) (actual time=5.099..18.347 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.258 1.258 ↓ 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.258..1.258 rows=10,865 loops=1)

  • Index Cond: (hotel_id = h.id)
18. 0.048 0.048 ↑ 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.006..0.006 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.040 0.040 ↑ 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.005 rows=1 loops=8)

  • Index Cond: (itinerary_id = hp.itinerary_id)
20. 0.056 0.056 ↑ 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.007 rows=2 loops=8)

  • Index Cond: (hb.id = itinerary_id)
21. 0.034 0.034 ↓ 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.002..0.002 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.237 ms
Execution time : 20.478 ms