POC for rewriting queries with Caggs, add early validations #8967
+2,999
−794
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.
POC currently checks whether queries can be rewritten with Caggs and rewrites queries with Caggs if it can.
GUCs
enable_cagg_rewitesandcagg_rewrites_debug_infoare OFF by default. If onlycagg_rewrites_debug_infois ON diagnostics on whether query can be rewritten with Caggs will be printed but query won't be rewritten.Only real-time Caggs are currently considered as candidates.
Reaggregation is out of scope for this POC i.e. we look for exact match on time buckets and aggregates provided by Caggs.
Validation methods in
tsl/src/continuous_aggs/common.cwere refactored and moved tosrc/planner/continuous_aggs_common.cso they could be reused by Cagg rewrites validations.PG15is currently not supported as view queries inPG15_LEhave dummy range table entries which complicates expression matching. As we plan to stopPG15support in 6 months it seems like an unnecessary complication to deal with.TODO: