How does SQL indexing work and when does an index help or hurt?
Asked in the Round 1 - technical screen stage. Listed as 'SQL indexing'. For the hands-on portion, use the supplied tables to return qualifying events and identify indexes that could support the query.
event_id, file_name, event_type, occurred_at, and user_nameoccurred_at descending, then event_id ascending| Column | Type | Description |
|---|---|---|
| user_idPK | INT | Unique user identifier |
| user_name | VARCHAR(100) | User display name |
| is_active | BOOLEAN | Whether the user is currently active |
| Column | Type | Description |
|---|---|---|
| event_idPK | INT | Unique event identifier |
| user_id | INT | User associated with the event |
| file_name | VARCHAR(150) | Name of the affected file |
| event_type | VARCHAR(30) | Type of file event |
| occurred_at | TIMESTAMP | Time when the event occurred |