fix(sql): invalidate dependent materialized views on base table rename#5693
Merged
bluestreak01 merged 48 commits intomasterfrom Jun 2, 2025
Merged
Conversation
…efreshed_mat_views
…efreshed_mat_views
…efreshed_mat_views
…efreshed_mat_views
…efreshed_mat_views
…efreshed_mat_views
…view_invalidation_on_table_rename
076f424 to
cfa90d7
Compare
…view_invalidation_on_table_rename
…view_invalidation_on_table_rename
…le by queries and mat view DDLs
…view_invalidation_on_table_rename
This reverts commit e8b57e4.
Contributor
[PR Coverage check]😍 pass : 34 / 36 (94.44%) file detail
|
Member
|
If I rename base table, view becomes "invalid", which is expected. If I rename table back to what it was, how do i get it to a valid state? This doesn't do it: REFRESH MATERIALIZED VIEW price_1h incremental; |
Contributor
Author
The table's contents/schema may have changed completely after it's renamed back, so you need to run a full refresh: REFRESH MATERIALIZED VIEW price_1h FULL; |
bluestreak01
approved these changes
Jun 2, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 #5602
Fixes dependent materialized views kept valid after a base table rename. The fix is moves the invalidation task being enqueued directly by the engine instead of WAL apply job like with other DDLs/DMLs. That's because dependent views are looked up by the base table name, not base table directory.
Other than that, includes the following fixes and changes:
cairo.mat.view.rows.per.query.estimatevalue to 1M (used to be 10M) as the old default was too high considering that the estimate is approximatecairo.mat.view.timer.start.epsilonproperty to make sure that new mat views with immediate start timestamp are triggered as soon as they're createdsample bytime unit is specified #5602). Also adds actual position to the error instead of the hard-coded-1