Discuss how you would optimize a slow-running query.
Assume the query joins Booking properties, cities, and bookings to count distinct guests for properties in the Netherlands during the first quarter of 2025. Explain the optimization approach and provide the resulting query for the required output.
Output
- One row per Netherlands property, including properties with no qualifying bookings.
- Columns:
property_id, property_name, city_name, and unique_guests.
- Include only bookings from 2025-01-01 through 2025-03-31, order by
unique_guests descending, then property_id ascending.