Drop the check regarding the presence of all computed partition statistics#15945
Merged
findepi merged 1 commit intotrinodb:masterfrom Mar 7, 2023
Merged
Drop the check regarding the presence of all computed partition statistics#15945findepi merged 1 commit intotrinodb:masterfrom
findepi merged 1 commit intotrinodb:masterfrom
Conversation
findepi
approved these changes
Feb 2, 2023
Contributor
Author
|
Please do not merge this one yet. |
Contributor
Author
|
I'll continue with this PR after landing #15995 |
…stics While computing the statistics, it may very well happen that the number of partitions in the table will change (partitions get added/dropped). Avoid failing the `ANALYZE` operation because of inequality of the number of computed partition statistics vs existing table partitions.
7245a15 to
b16fd74
Compare
findinpath
commented
Feb 28, 2023
| Supplier<PartitionStatistics> emptyPartitionStatistics = Suppliers.memoize(() -> createEmptyPartitionStatistics(columnTypes, columnStatisticTypes)); | ||
|
|
||
| int usedComputedStatistics = 0; | ||
| List<Type> partitionTypes = handle.getPartitionColumns().stream() |
Contributor
Author
There was a problem hiding this comment.
The PR is not accompanied by corresponding tests because I don't see a way to consistently simulating a situation where partitions get effectively removed during the computation of statistics.
Member
|
@ebyhr ptal |
ebyhr
approved these changes
Feb 28, 2023
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.
Description
While computing the statistics, it may very well happen that the number of partitions in the table will change (partitions get added/dropped). Avoid failing the
ANALYZEoperation because of inequality of the number of computed partition statistics vs existing table partitions.Additional context and related issues
In some situations it may happen that
ANALYZE tableoperation is failing with the messageIf the number of the partitions of the table changes between the time when the computing of the partitions stats has started and when it ended, this exception is likely to appear.
Avoid the failure of the operation by dropping the verification for the equality of the number of computed partition statistics vs existing table partitions.
Release notes
(x) This is not user-visible or docs only and no release notes are required.
( ) Release notes are required, please propose a release note for me.
( ) Release notes are required, with the following suggested text: