*wip* Query cache persistence #63091
Draft
+274
−49
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes: #58228
Fixes: #52141
30% done, not review-able yet. Uploading it as PR only in case my laptop catches fire.
The server now stores/loads the content of the query cache (i.e. cached query results) to/from disk during server shutdown/startup.
The data is stored in subdirectory
query_cache/
relative to the base directory (<path>...</path>
) in the server configuration).To support future changes of the persistence format, a file
query_cache/format_version.txt
stores the version of the data, e.g.1
. Backward compatibility will likely not be implemented, i.e. future ClickHouse versions which support query cache persistence format versions > 1 will not be able to read earlier formats (existing data will simply be deleted).In format v1, query cache entries are serialized like this:
query_cache/496d3a8d63e7/
.Query cache serialization/deserialization can be enabled using a server setting (default: true):
Changelog category (leave one):