OnlineDDL: skip GetSchema where possible #10107
Merged
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.
Description
In
ApplySchema
, there is a check for big schema changes. This is a legacy check from a time when we did not support online DDL. Big-schema-changes is mostly skipped when there are online DDLs. However, one step is not skipped, which isGetSchema
.Currently, we first
GetSchema
, then iterate all DDLs, and for each DDL check if it is online or not, and if not - whether it is a "big change".When all DDLs are online, the
GetSchema
step is wasteful. It reads all tables with some metadata.In this PR, we first do a preliminary check to see whether there is at all any non-online DDL. If there is at least one non-online DDL, we proceed with
GetSchema
. But if all DDLs are online - we skipGetSchema
altogether.Related Issue(s)
Checklist