Repository navigation
Speed up CAST from Enum to LowCardinality(String) - #127241
Conversation
|
Workflow [PR], commit [81e58ff] Summary: ✅
AI ReviewSummarySpeeds up Final VerdictStatus: ✅ Approve |
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Object file sizes4 object files changed (+53.11 KiB total), 0 added.
719 more object files are built by the master warmup baseline only (it builds every object-file target, a pull request build only Compile time of recompiled translation units7 translation units recompiled, 57 s compile time in total, 7 of them have a recent master baseline. |
Casting
Enum8/Enum16toLowCardinality(String)copied the name of every row and inserted it into the dictionary with a hash lookup. Now the values are mapped to indexes in a dictionary of all enum names built once per query, and each block inserts only the names it uses. This also covers nested types, such asMap(Enum16(...), Int64)cast toMap(LowCardinality(String), Int64), which #127195 uses to read the keys ofsystem.all_metric_logby name. For anEnum16with 2000 values, the cast of 40M values on one thread takes 0.22 s instead of 3.7 s (17x faster), and reading a whole map column through such aMergetable takes 0.11 s instead of 0.9 s (8x faster).Related: #127195
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Speed up
CASTfromEnum8andEnum16toLowCardinality(String), also insideMap,ArrayandTuple.Workflow [PR]
Sync PR [sync-upstream/pr/127241]
Version info
26.11.1.899-master(included in26.11and later)