-- Database indexes for optimizing room availability queries
-- These indexes will significantly improve search performance

-- Index for bookings date range queries (most important)
CREATE INDEX IF NOT EXISTS idx_bookings_dates_status ON bookings(status, check_in_date, check_out_date);

-- Index for room filtering
CREATE INDEX IF NOT EXISTS idx_rooms_status_hotel ON rooms(status, hotel_id, is_active);

-- Index for hotel filtering
CREATE INDEX IF NOT EXISTS idx_hotels_active ON hotels(is_active);

-- Composite index for booking room lookups
CREATE INDEX IF NOT EXISTS idx_bookings_room_dates ON bookings(room_id, check_in_date, check_out_date, status);

-- Index for room availability queries
CREATE INDEX IF NOT EXISTS idx_rooms_available ON rooms(is_active, status);