SQL Practice Logo

SQLPractice Online

Level 7 - ArchitectScenario-Based Questionsm1 indexing strategy

Scenario: Geo Search and Secondary Index Choice

A delivery app query filters city_id, active flag, and sorts by updated_at desc. Occasionally it also filters vehicle_type. Propose primary index strategy and what not to index initially.

Schema Context

drivers(driver_id, city_id, active, vehicle_type, updated_at, current_lat, current_lng)