-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
release-20.2: sql: fix CREATE STATISTICS for partial indexes #64226
Merged
mgartner
merged 1 commit into
cockroachdb:release-20.2
from
mgartner:63387-inverted-stats
Apr 26, 2021
Merged
release-20.2: sql: fix CREATE STATISTICS for partial indexes #64226
mgartner
merged 1 commit into
cockroachdb:release-20.2
from
mgartner:63387-inverted-stats
Apr 26, 2021
Conversation
This file contains 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
This commit fixes a bug that caused errors when creating stats for a table with a partial index predicate containing references to inverted-type columns, like JSON and ARRAY. Fixes cockroachdb#63387 Release note (bug fix): The `CREATE STATISTICS` command no longer fails when creating statistics on a table with a partial index predicate containing references to an inverted-type column, such as `JSON`, `ARRAY`, `GEOMETRY`, or `GEOGRAPHY`. This bug was present since partial indexes were introduced in version 20.2.0.
mgartner
added a commit
to mgartner/cockroach
that referenced
this pull request
Apr 26, 2021
This is a "forward-port" of regression tests from cockroachdb#64226. This commit contains no code changes because the bug was already been fixed on master by cockroachdb#59687. Release note: None
RaduBerinde
approved these changes
Apr 26, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status:
complete! 1 of 0 LGTMs obtained (waiting on @rytaft)
mgartner
added a commit
to mgartner/cockroach
that referenced
this pull request
Apr 26, 2021
This is a "forward-port" of regression tests from cockroachdb#64226. This commit contains no code changes because the bug was already been fixed on master by cockroachdb#59687. Release note: None
craig bot
pushed a commit
that referenced
this pull request
Apr 27, 2021
64225: opt: make placeholder fast path conditional on the estimated row count r=RaduBerinde a=RaduBerinde #### opt: show statistics in placeholder-fast-path tests This highlights a problem with the fast path: we use statistics that are derived using placeholders, which are usually terrible. Release note: None #### opt: mark columns as constant for equality with placeholder This commit improves the FD generation for Select when we have filters like `x = $1`. Because these filters have placeholders, they do not generate constraints (which is the normal mechanism for detecting constant columns). This improves the cardinality property and row count estimate. The estimate will be used for the placeholder fast path. Release note: None #### opt: make placeholder fast path conditional on the estimated row count This change is best explained by this comment: ``` // We are dealing with a memo that still contains placeholders. The statistics // for such a memo can be wildly overestimated. Even if our plan is correct, // the estimated row count for a scan is passed to the execution engine which // uses it to make sizing decisions. Passing a very high count can affect // performance significantly (see #64214). So we only use the fast path if the // estimated row count is small; typically this will happen when we constrain // columns that form a key and we know there will be at most one row. ``` Fixes #64214. Release note (bug fix): fixed a performance regression for very simple queries. 64229: sql: add CREATE STATISTICS regression test r=mgartner a=mgartner This is a "forward-port" of regression tests from #64226. This commit contains no code changes because the bug was already been fixed on master by #59687. Release note: None 64235: roachtest: update version map and fixtures r=darinpp a=darinpp This commit adds the recently released 20.1.15 to the version map in PredecessorVersion. Release note: None (testing change) Co-authored-by: Radu Berinde <[email protected]> Co-authored-by: Marcus Gartner <[email protected]> Co-authored-by: Darin Peshev <[email protected]>
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.
This commit fixes a bug that caused errors when creating stats for a
table with a partial index predicate containing references to
inverted-type columns, like JSON and ARRAY.
Fixes #63387
Release note (bug fix): The
CREATE STATISTICS
command no longer failswhen creating statistics on a table with a partial index predicate
containing references to an inverted-type column, such as
JSON
,ARRAY
,GEOMETRY
, orGEOGRAPHY
. This bug was present since partialindexes were introduced in version 20.2.0.