Repository navigation
Skip back up of refreshable materialized view targets - #93076
Conversation
|
Workflow [PR], commit [f99d268] Summary: ❌
|
93b594b to
1dc4dbd
Compare
|
We need to skip backing up the data only for target tables of refreshable views. And only for those that replace the target table entirely (defined without an The idea is: a target table of a regular MV or a RMV with APPEND mode contains historical data. To recalculate it the user has to do some manual work, when a target for a regular RMV contains an intermediate data that lives not that long (for about a refresh period). |
|
It's ready for another look btw. |
| if (!table || table->getName() != "MaterializedView") | ||
| return false; | ||
|
|
||
| const auto * mv = dynamic_cast<const StorageMaterializedView *>(table.get()); |
There was a problem hiding this comment.
Why dynamic_cast here? Should we throw an exception in case if this case returns nullptr?
There was a problem hiding this comment.
isRefreshable and getTargetTable is not a part of IStorage interface:
Sure, I think a mismatch should be a LOGICAL_ERRROR
cb76bf0 to
9160aa5
Compare
9160aa5 to
f99d268
Compare
|
This PR added caused a new segmentation fault (see #93673), so it seems right that this PR was reverted. |
|
I fixed it here, also, I moved the logic determining whether to back up data or not to an earlier stage. |
Resubmit 'Skip back up of refreshable materialized view targets' #93076
…ialized view targets' #93076
…ialized view targets' #93076
…ialized view targets' #93076
Changelog category (leave one):
During
BACKUP, if a table is a target of one or more refreshable materialized views and the settingbackup_data_from_refreshable_materialized_view_targetsis set to false, the table’s data is not copied into the backup. The exception is RMVs with APPEND refresh strategy which are always backed up.Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Introduced the
backup_data_from_refreshable_materialized_view_targetsbackup setting to skip back up of refreshable materialized views. RMVs with APPEND refresh strategy which are always backed up.Documentation entry for user-facing changes