explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 29Sc

Settings
# exclusive inclusive rows x rows loops node
1. 0.003 17.863 ↑ 14,436.0 1 1

Nested Loop (cost=1.62..1,087,716.63 rows=14,436 width=586) (actual time=0.365..17.863 rows=1 loops=1)

  • Planning time: 1.207 ms
  • Execution time: 17.975 ms
2. 0.645 17.851 ↑ 14,436.0 1 1

Nested Loop (cost=1.19..1,080,428.52 rows=14,436 width=4) (actual time=0.354..17.851 rows=1 loops=1)

3. 5.254 5.254 ↑ 68.9 1,494 1

Index Scan using index_bookings_on_multicolumns_hotel_id_status_checkin_source_c on bookings (cost=0.63..318,010.51 rows=102,959 width=4) (actual time=0.014..5.254 rows=1,494 loops=1)

  • Index Cond: ((hotel_id = ANY ('{49666,49667,49699,49704,49707,49712,49714,49730,49737,49739,49743,49744,49752,49755,49756,49761,49763,49774,49778,49779,49784,49785,49792,49798,49805,49812,49813,49814,49819,49820,49828,49834,49835,49838,49852,49860,49867,49908,49924,49931,49934,49938,49939,49953,49966,49675,49683,49686,49688,49694}'::integer[])) AND (status = ANY ('{0,1,2}'::integer[])))
4. 11.952 11.952 ↓ 0.0 0 1,494

Index Scan using index_redeemed_coupons_on_booking_id on redeemed_coupons (cost=0.56..7.40 rows=1 width=8) (actual time=0.008..0.008 rows=0 loops=1,494)

  • Index Cond: (booking_id = bookings.id)
  • Filter: ((coupon_code)::text = 'OYOAPP30'::text)
  • Rows Removed by Filter: 1
5. 0.009 0.009 ↑ 1.0 1 1

Index Scan using coupons_pkey on coupons (cost=0.42..0.49 rows=1 width=586) (actual time=0.008..0.009 rows=1 loops=1)

  • Index Cond: (id = redeemed_coupons.coupon_id)