v.22.2Improvement
Improvements to range_hashed dictionaries in ClickHouse
Improvements forrange_hasheddictionaries. Improve performance of load time if there are multiple attributes. Allow to create a dictionary without attributes. Added option to specify strategy when intervalsstartandendhaveNullabletypeconvert_null_range_bound_to_openby default istrue. Closes #29791. Allow to specifyFloat,Decimal,DateTime64,Int128,Int256,UInt128,UInt256as range types.RangeHashedDictionaryadded support for range values that extendInt64type. Closes #28322. Added optionrange_lookup_strategyto specify range lookup typemin,maxby default ismin. Closes #21647. Fixed allocated bytes calculations. Fixed type name insystem.dictionariesin case ofComplexKeyHashedDictionary. #33927 (Maksim Kita).
Why it matters
This feature improves the usability and performance ofrange_hashed dictionaries by allowing faster loading times when multiple attributes exist and enabling dictionaries without attributes to be created. It enhances flexibility by supporting wider data types for range bounds, including large integer and decimal types, which solve limitations on range value types. The new options for handling Nullable interval bounds and specifying the range lookup strategy provide better control over dictionary behavior and querying accuracy.How to use it
Users can leverage these improvements by updating dictionary definitions to include the new supported range types in theirrange_hashed dictionaries. They can also enable the convert_null_range_bound_to_open option (enabled by default) to handle Nullable interval bounds. Additionally, the range_lookup_strategy option allows users to select how range lookups behave, with possible values min or max (default is min). Creating dictionaries without attributes is now also supported by simply omitting attribute definitions.