How do you optimize database performance for high-traffic applications?
For the SQL portion, write a query that summarizes active API endpoints using requests from September 2026. Include only endpoints with at least two requests during the period, while preserving efficient timestamp filtering.
endpoint_name, request_count, avg_latency_ms, and error_rate_pct.2026-09-01 00:00:00 inclusive through 2026-10-01 00:00:00 exclusive.avg_latency_ms to two decimal places.error_rate_pct to two decimal places.| Column | Type | Description |
|---|---|---|
| endpoint_idPK | INT | Unique API endpoint identifier |
| endpoint_name | VARCHAR(120) | Endpoint path or logical name |
| is_active | BOOLEAN | Whether the endpoint is currently active |
| Column | Type | Description |
|---|---|---|
| request_idPK | INT | Unique request identifier |
| endpoint_id | INT | Referenced API endpoint |
| requested_at | TIMESTAMP | Time when the request was received |
| latency_ms | INT | Request latency in milliseconds |
| status_code | INT | HTTP response status code |