-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix time frame calculation for processors profiling
Previously "query_start_time_microseconds + query_duration_ms" was used, which is not always correct, we should use "event_time_microseconds" instead (since we extract everything except QueryStart from query_log). Here is an example of timeframe difference: SELECT max(query_start_time_microseconds) AS t, max(query_duration_ms) AS d, t + (d / 1000.) FROM system.query_log WHERE query_id IN ('34146bc1-09e5-4468-b9a6-be9fb521240f', '34146bc1-09e5-4468-b9a6-be9fb521240f', 'bd961ef8-5d70-470c-b9d7-0dbe901e31a3', '3c73ea8b-34e7-4d2f-ab34-3c551d3c0c68') ┌──────────────────────────t─┬────d─┬─plus(max(query_start_time_microseconds), divide(max(query_duration_ms), 1000.))─┐ │ 2024-05-26 16:14:55.582473 │ 5638 │ 2024-05-26 16:15:00.582473 │ └────────────────────────────┴──────┴─────────────────────────────────────────────────────────────────────────────────┘ SELECT min(event_time_microseconds), max(event_time_microseconds) FROM system.processors_profile_log WHERE query_id IN ('34146bc1-09e5-4468-b9a6-be9fb521240f', '34146bc1-09e5-4468-b9a6-be9fb521240f', 'bd961ef8-5d70-470c-b9d7-0dbe901e31a3', '3c73ea8b-34e7-4d2f-ab34-3c551d3c0c68') ┌─min(event_time_microseconds)─┬─max(event_time_microseconds)─┐ │ 2024-05-26 16:14:58.455948 │ 2024-05-26 16:15:00.838703 │ └──────────────────────────────┴──────────────────────────────┘
- Loading branch information
Showing
3 changed files
with
12 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters