-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Labels
perfPerformance improvements and benchmarksPerformance improvements and benchmarks
Description
Following #286:
During query execution, we should first analyze all label matches and group them into "attribute-only", "resource-only" or "both".
To do it fast, there should be a materialized view or additional table that holds this information.
So, before:
SELECT name, timestamp, mapping, value, flags, attributes, resource
FROM `metrics_points`
WHERE true
AND toUnixTimestamp64Nano(timestamp) >= 1704546540000000000
AND toUnixTimestamp64Nano(timestamp) <= 1704549765000000000
AND (
JSONExtractString(attributes, 'instance') = 'host-0'
OR JSONExtractString(resource, 'instance') = 'host-0'
)
AND (
JSONExtractString(attributes, 'job') = 'node_exporter'
OR JSONExtractString(resource, 'job') = 'node_exporter'
)
AND (
JSONExtractString(attributes, 'mode') = 'user'
OR JSONExtractString(resource, 'mode') = 'user'
)
AND (
name = 'node_cpu_seconds_total'
)
ORDER BY timestamp;
After:
SELECT name, timestamp, mapping, value, flags, attributes, resource
FROM `metrics_points`
WHERE true
AND toUnixTimestamp64Nano(timestamp) >= 1704546540000000000
AND toUnixTimestamp64Nano(timestamp) <= 1704549765000000000
AND JSONExtractString(resource, 'instance') = 'host-0'
AND JSONExtractString(resource, 'job') = 'node_exporter'
AND JSONExtractString(attributes, 'mode') = 'user'
AND name = 'node_cpu_seconds_total'
ORDER BY timestamp;
Metadata
Metadata
Assignees
Labels
perfPerformance improvements and benchmarksPerformance improvements and benchmarks