v.24.8New Feature

Added Tagging Mechanism for Query Cache in ClickHouse

Added a tagging (namespace) mechanism for the query cache. The same queries with different tags are considered different by the query cache. Example: SELECT 1 SETTINGS use_query_cache = 1, query_cache_tag = 'abc' and SELECT 1 SETTINGS use_query_cache = 1, query_cache_tag = 'def' now create different query cache entries. #68235 (sakulali).
Added a tagging (namespace) mechanism for the query cache in ClickHouse, allowing queries with different tags to be cached separately.

Why it matters

This feature enables differentiation of cached query results based on user-defined tags, preventing cache collisions for queries with the same text but different contexts. It improves cache management and query result accuracy in multi-tenant or multi-context environments.

How to use it

To use this feature, enable the query cache and assign a tag to the query using the query_cache_tag setting alongside use_query_cache = 1. For example:

SELECT 1 SETTINGS use_query_cache = 1, query_cache_tag = 'your_tag'