You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently [query execution
metrics](https://hud.pytorch.org/query_execution_metrics) hud page shows
only a couple of previous days, regardless of date range selected. This
happens because in CH query log data is spread across multiple query_log
tables with numeric suffix:
<img width="203" alt="image"
src="https://github.com/user-attachments/assets/44e03730-310e-4110-9423-1608b879bfe0"
/>
(apparently CH create a new table when the schema changes)
The solution is to create a special "merge" table:
```
CREATE TABLE all_query_logs
ENGINE = Merge('system', '^query_log(_\\d+)?$');
```
and query it instead.
This ephemeral table queries all the underlying tables under the hood
and merges the results.
This is not a big performance hit, as I also added correct filters
(matching partitioning and table order), so only relevant data is
touched.
### Testing
Locally. See [the vercel
preview](https://torchci-git-fix-query-execution-metrics-page-fbopensource.vercel.app/query_execution_metrics).
0 commit comments