Describe your approach to optimizing database queries for high-traffic services.
Using the provided service and request data, write a PostgreSQL query that returns services with at least two requests during January 2026. Include only requests in that date range. The result should support evaluating traffic, latency, and server errors.
service_name, request_count, avg_duration_ms, error_rate_pct2026-01-01 00:00:00 and exclusive at 2026-02-01 00:00:00.avg_duration_ms to two decimal places.error_rate_pct as the percentage of requests with status_code >= 500, rounded to two decimal places.| Column | Type | Description |
|---|---|---|
| service_idPK | INTEGER | Unique service identifier |
| service_name | VARCHAR(100) | Display name of the service |
| Column | Type | Description |
|---|---|---|
| request_idPK | BIGINT | Unique request identifier |
| service_id | INTEGER | Referenced service identifier |
| requested_at | TIMESTAMP | Timestamp when the request was received |
| endpoint | VARCHAR(150) | Requested API endpoint |
| status_code | INTEGER | HTTP response status code |
| duration_ms | INTEGER | Request duration in milliseconds |