v.25.12New Feature
Implement dictGetKeys function that returns the dictionary
ImplementdictGetKeysfunction that returns the dictionary key(s) whose attribute equals the specified value. It uses a per-query reverse-lookup cache, tuned by themax_reverse_dictionary_lookup_cache_size_bytessetting, to speed up repeated lookups. #89197 (Nihal Z. Miaji).
Why it matters
This feature solves the problem of efficiently performing reverse lookups in ClickHouse dictionaries, where users want to find keys based on attribute values. It adds value by leveraging a per-query reverse-lookup cache to speed up repeated lookups, improving query performance in such scenarios.How to use it
Users can call thedictGetKeys function by specifying the dictionary name, the attribute to compare, and the attribute value to find corresponding keys. The function utilizes a per-query reverse-lookup cache controlled by the max_reverse_dictionary_lookup_cache_size_bytes setting, which can be tuned to optimize performance.