v.24.6Improvement

Query Cache Now Differentiates Identical Queries with Varying Settings

The query cache now considers identical queries with different settings as different. This increases robustness in cases where different settings (e.g. limit or additional_table_filters) would affect the query result. #64205 (Robert Schulze).
The query cache in ClickHouse now distinguishes identical queries executed with different settings, treating them as separate cached entries.

Why it matters

This feature solves the issue where queries with the same text but different settings such as limit or additional_table_filters were considered identical and shared the same cached result. By considering these settings, the query cache provides more accurate results, increasing robustness and correctness when query settings affect outputs.

How to use it

No explicit action is needed by users to enable this feature. The query cache automatically accounts for query settings differences when caching results.