v.22.2Improvement

Improvements to range_hashed dictionaries in ClickHouse

Improvements for range_hashed dictionaries. Improve performance of load time if there are multiple attributes. Allow to create a dictionary without attributes. Added option to specify strategy when intervals start and end have Nullable type convert_null_range_bound_to_open by default is true. Closes #29791. Allow to specify Float, Decimal, DateTime64, Int128, Int256, UInt128, UInt256 as range types. RangeHashedDictionary added support for range values that extend Int64 type. Closes #28322. Added option range_lookup_strategy to specify range lookup type min, max by default is min . Closes #21647. Fixed allocated bytes calculations. Fixed type name in system.dictionaries in case of ComplexKeyHashedDictionary. #33927 (Maksim Kita).
Enhancements to range_hashed dictionaries including improved load performance with multiple attributes, support for creating dictionaries without attributes, and extended support for various range types such as Float, Decimal, DateTime64, Int128, Int256, UInt128, and UInt256. Added options to handle Nullable interval bounds and specify range lookup strategies.

Why it matters

This feature improves the usability and performance of range_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 their range_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.