v.25.12New Feature

Implement dictGetKeys function that returns the dictionary

Implement dictGetKeys function that returns the dictionary key(s) whose attribute equals the specified value. It uses a per-query reverse-lookup cache, tuned by the max_reverse_dictionary_lookup_cache_size_bytes setting, to speed up repeated lookups. #89197 (Nihal Z. Miaji).
Introduces the dictGetKeys function that returns dictionary key(s) for which a specified attribute matches a given value, enabling reverse lookups on dictionaries.

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 the dictGetKeys 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.