Explain the concept of database indexing and when you would use a composite index versus a single-column index.
Discuss the trade-offs involving query predicates, column order, selectivity, sorting, and write overhead. Use the provided PostgreSQL tables to demonstrate appropriate index definitions and a representative filtered query.
organization_id, response_id, and submitted_at.submitted_at ascending, then response_id ascending.| Column | Type | Description |
|---|---|---|
| organization_idPK | INT | Unique organization identifier |
| organization_name | VARCHAR(100) | Organization display name |
| Column | Type | Description |
|---|---|---|
| response_idPK | INT | Unique survey response identifier |
| organization_id | INT | Organization associated with the response |
| submitted_at | TIMESTAMP | Response submission timestamp |
| response_status | VARCHAR(20) | Processing status of the response |
| channel | VARCHAR(30) | Submission channel |