How do you manage partitioning and indexing strategies to improve performance?
Use the provided PostgreSQL schema to demonstrate a time-bounded query against event data. Your solution should return active applications, including those with no matching events, and reflect an indexing strategy that supports the join and time-range filter.
application_id, event_count, and latest_event_atevent_count descending, then application_id ascending| Column | Type | Description |
|---|---|---|
| application_idPK | INT | Unique application identifier |
| status | VARCHAR(20) | Current application status |
| Column | Type | Description |
|---|---|---|
| event_idPK | INT | Unique event identifier |
| application_id | INT | Application associated with the event |
| occurred_at | TIMESTAMP | Event timestamp and partitioning key |
| event_type | VARCHAR(30) | Type of application event |