v.25.9Improvement

System table system.query_cache now returns all query

System table system.query_cache now returns all query result cache entries, whereas it previously returned only shared entries or non-shared entries of the same user and role. That is okay as non-shared entries are supposed to not reveal query results, whereas system.query_cache returns query strings. This makes the behavior of the system table more similar to system.query_log. #87104 (Robert Schulze).
The system.query_cache table now returns all query result cache entries, including both shared and non-shared entries regardless of user or role.

Why it matters

Previously, system.query_cache returned only shared entries or non-shared entries belonging to the same user and role, limiting visibility. The change improves transparency by exposing all cached query strings, aligning the behavior more closely with system.query_log. This helps users better monitor and analyze cached queries across all users.

How to use it

Users can query the system.query_cache table as before via SELECT * FROM system.query_cache. There is no special configuration required to see all entries after the update.