Commit graph

2 commits

Author SHA1 Message Date
Drew Davis
8190ee8f6a
perf: Improve getKeyValues query performance for JSON keys (#1284)
Closes HDX-2623

# Summary

This change improves the performance of `getKeyValues` when getting values of a JSON key. 

Generally, columns that are not referenced outside of a CTE will be pruned by the query planner. For JSON however, if the outer select references one field in a JSON column, then the inner select will read (it seems) the entire JSON object.

This PR also adds integration tests for `getKeyValues` to ensure that the function generates queries that work as expected in ClickHouse.

##  Performance impact (on single JSON Dashboard Filter)

- Original: 15.03s

<img width="584" height="71" alt="Screenshot 2025-10-21 at 3 28 07 PM" src="https://github.com/user-attachments/assets/184de198-cee1-4b1d-beed-ec4465d3e248" />

- Optimized: 0.443s

<img width="590" height="61" alt="Screenshot 2025-10-21 at 3 25 47 PM" src="https://github.com/user-attachments/assets/690d0ef0-15b8-47c5-9a7e-8b8f6b8f5e92" />
2025-10-27 16:46:46 +00:00
Warren
6ee29abe02
feat: introduce common-utils package (#554)
- copy and paste the utils to a separate dir
- setup building + CD
2025-01-16 18:15:22 +00:00