Prompt
query recent and historical metrics fast
Latest observation
Oct 10, 2026
OpenAI APIWeb search: off
Can you clarify what you want to query?
If you mean recent and historical metrics fast, I can help you:
- write a SQL query for time-series metrics
- design a fast aggregation query pattern
- compare recent window vs historical baseline
- optimize for Postgres / MySQL / BigQuery / ClickHouse / Prometheus / Elasticsearch
Please send:
- database/system
- table/schema
- metric name
- time range for “recent” and “historical”
- any grouping you want (by host, service, region, etc.)
Example:
SELECT
date_trunc('hour', ts) AS hour,
avg(value) AS avg_value
FROM metrics
WHERE ts >= now() - interval '7 days'
GROUP BY 1
ORDER BY 1;
If you want, I can also give you a fast template for querying recent + historical metrics right away.