explain.depesz.com

PostgreSQL's explain analyze made readable

Result: KUd4

Settings
# exclusive inclusive rows x rows loops node
1. 5.292 431,248.912 ↑ 1.0 1 1

Aggregate (cost=358,524.25..358,524.26 rows=1 width=34) (actual time=431,248.910..431,248.912 rows=1 loops=1)

2. 81.812 431,243.620 ↓ 750.0 750 1

Subquery Scan on t (cost=358,524.21..358,524.24 rows=1 width=8) (actual time=430,823.408..431,243.620 rows=750 loops=1)

  • Filter: (t.r <= 750)
  • Rows Removed by Filter: 180400
3. 247.944 431,161.808 ↓ 181,150.0 181,150 1

WindowAgg (cost=358,524.21..358,524.23 rows=1 width=16) (actual time=430,823.401..431,161.808 rows=181,150 loops=1)

4. 572.650 430,913.864 ↓ 181,150.0 181,150 1

Sort (cost=358,524.21..358,524.21 rows=1 width=8) (actual time=430,823.306..430,913.864 rows=181,150 loops=1)

  • Sort Key: hpm.price
  • Sort Method: quicksort Memory: 13953kB
5. 486.303 430,341.214 ↓ 181,150.0 181,150 1

Nested Loop Left Join (cost=5.43..358,524.20 rows=1 width=8) (actual time=9.922..430,341.214 rows=181,150 loops=1)

  • Filter: ((1) IS NULL)
  • Rows Removed by Filter: 5610
6. 645.813 426,493.231 ↓ 6,024.5 186,760 1

Nested Loop (cost=1.56..353,807.36 rows=31 width=24) (actual time=9.854..426,493.231 rows=186,760 loops=1)

7. 59,361.324 425,287.138 ↓ 6,024.5 186,760 1

Nested Loop (cost=1.27..353,797.98 rows=31 width=28) (actual time=9.838..425,287.138 rows=186,760 loops=1)

  • Join Filter: (ho.id = hpm.hotel)
  • Rows Removed by Join Filter: 125012015
8. 60.970 125.314 ↓ 326.7 63,375 1

Nested Loop (cost=0.71..1,583.09 rows=194 width=8) (actual time=0.293..125.314 rows=63,375 loops=1)

9. 16.374 16.374 ↓ 8.9 195 1

Index Scan using ix5_hotelonline on hotelonline ho (cost=0.28..1,495.22 rows=22 width=8) (actual time=0.152..16.374 rows=195 loops=1)

  • Index Cond: (country = 33)
  • Filter: (place = ANY ('{870,873,875,879,881,2050,2052,2054,2056,2172,5734,8219,8731,9125,10276}'::integer[]))
  • Rows Removed by Filter: 535
10. 47.970 47.970 ↓ 36.1 325 195

Index Only Scan using ix_datetoarea3 on datetoarea dt (cost=0.43..3.90 rows=9 width=8) (actual time=0.025..0.246 rows=325 loops=195)

  • Index Cond: ((fromarea = 2449) AND (toarea = ho.area) AND (country = 33))
  • Heap Fetches: 0
11. 113,251.125 365,800.500 ↑ 10.0 1,976 63,375

Append (cost=0.56..1,567.89 rows=19,812 width=28) (actual time=0.003..5.772 rows=1,976 loops=63,375)

12. 158,821.650 158,821.650 ↓ 1.1 13,392 5,850

Index Scan using hpm_2020_04_country_accdetail_checkindate_night_price_idx on hpm_2020_04 hpm (cost=0.56..856.19 rows=12,479 width=28) (actual time=0.005..27.149 rows=13,392 loops=5,850)

  • Index Cond: ((country = 33) AND (accdetail = ANY ('{4,28016}'::integer[])) AND (checkindate = dt.checkindate) AND (checkindate >= '2020-04-26'::date) AND (checkindate <= '2020-05-03'::date) AND (night >= 7) AND (night <= 14))
13. 93,727.725 93,727.725 ↓ 1.1 7,751 6,045

Index Scan using hpm_2020_05_country_accdetail_checkindate_night_price_idx on hpm_2020_05 hpm_1 (cost=0.56..612.64 rows=7,333 width=28) (actual time=0.003..15.505 rows=7,751 loops=6,045)

  • Index Cond: ((country = 33) AND (accdetail = ANY ('{4,28016}'::integer[])) AND (checkindate = dt.checkindate) AND (checkindate >= '2020-04-26'::date) AND (checkindate <= '2020-05-03'::date) AND (night >= 7) AND (night <= 14))
14. 560.280 560.280 ↑ 1.0 1 186,760

Index Only Scan using pk_accdetail on accdetail acc (cost=0.29..0.30 rows=1 width=4) (actual time=0.003..0.003 rows=1 loops=186,760)

  • Index Cond: (id = hpm.accdetail)
  • Heap Fetches: 0
15. 933.800 3,361.680 ↓ 0.0 0 186,760

Limit (cost=3.87..152.14 rows=1 width=4) (actual time=0.018..0.018 rows=0 loops=186,760)

16. 1,494.080 2,427.880 ↓ 0.0 0 186,760

Bitmap Heap Scan on stopsaleonlinegroup s (cost=3.87..152.14 rows=1 width=4) (actual time=0.013..0.013 rows=0 loops=186,760)

  • Recheck Cond: (hotel = hpm.hotel)
  • Filter: ((enddate >= hpm.checkindate) AND (country = 33) AND ((room = hpm.room) OR (room = '-1'::integer)) AND (((NOT checkin) AND (begindate < hpm.checkoutdate)) OR (checkin AND (begindate <= hpm.checkoutdate))))
  • Rows Removed by Filter: 27
  • Heap Blocks: exact=194112
17. 933.800 933.800 ↑ 2.1 29 186,760

Bitmap Index Scan on stopsaleonlinegroup_hotel_fromtype_idx (cost=0.00..3.87 rows=60 width=0) (actual time=0.005..0.005 rows=29 loops=186,760)

  • Index Cond: (hotel = hpm.hotel)
Planning time : 9.082 ms
Execution time : 431,250.769 ms