Your question is Indexing and Query Performance. Start with the requirements and the one table on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Explain the importance of indexing in databases.
Use the provided PostgreSQL tickets table to demonstrate a selective lookup. Write a query that returns open tickets created on or after January 1, 2025, and briefly explain how an appropriate index could improve this query.
ticket_id, status, priority, and created_atcreated_at first, then ticket_id ascending| Column | Type | Description |
|---|---|---|
| ticket_idPK | INT | Unique ticket identifier |
| status | VARCHAR(20) | Current ticket status |
| priority | VARCHAR(20) | Ticket priority |
| created_at | DATE | Date the ticket was created |