[CH][HUD] Set query_id parameter for ClickHouse queries #6091
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Set the query_id to be
query_name-uuid
for named queries oradhoc-uuid
in the case of adhoc queries.This is helpful for getting average time and memory usage for queries and mapping them back to the original query. The system.query_log table can be used to find this information (https://clickhouse.com/docs/knowledgebase/find-expensive-queries) but when using the ClickHouse javascript package, the query column there is a parsed version of the query which is hard to map back to the original query text.
The query_id needs to be unique for every query and the docs suggest using a uuid
https://clickhouse.com/docs/en/integrations/javascript#query-id