Skip to content

sql: add optimizer_use_improved_disjunction_stats session setting#94389

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
mgartner:add-setting-for-new-stats-disjunction-improvements
Dec 29, 2022
Merged

sql: add optimizer_use_improved_disjunction_stats session setting#94389
craig[bot] merged 1 commit intocockroachdb:masterfrom
mgartner:add-setting-for-new-stats-disjunction-improvements

Conversation

@mgartner
Copy link
Copy Markdown
Contributor

@mgartner mgartner commented Dec 28, 2022

This commit adds the optimizer_use_improved_disjunction_stats session
setting that defaults to true. When true, the improved disjunction
logic added in #89358 is performed. When false, the logic reverts to
the previous logic. This setting will allow use to backport the new
logic without impacting query plans of running clusters by defaulting
the setting to false.

Epic: None

Release note: None

@mgartner mgartner requested a review from a team as a code owner December 28, 2022 20:52
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

Copy link
Copy Markdown
Collaborator

@DrewKimball DrewKimball left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm: Is there a specific case we're hoping to improve with this or is it a general improvement?

Reviewed 8 of 8 files at r1, all commit messages.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @msirek)

Copy link
Copy Markdown
Contributor

@msirek msirek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think InternalExecutor.execInternal doesn't always copy default session settings over, so may sometimes use a LocalOnlySessionData with all false and 0 values. To be sure the new code path isn't used for internal SQL execution in the backports you could invert optimizer_use_improved_disjunction_stats. Name it something like optimizer_disable_improved_disjunction_stats and make the default be false.

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @mgartner)

Copy link
Copy Markdown
Contributor Author

@mgartner mgartner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DrewKimball see https://github.com/cockroachlabs/support/issues/1971

@msirek A false value disables the new code path. I'm planning on changing the globalTrue to globalFalse in the backports. Will that not be sufficient to ensure that it's disabled?

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @mgartner)

Copy link
Copy Markdown
Contributor

@msirek msirek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that sounds good.
:lgtm:

Reviewable status: :shipit: complete! 2 of 0 LGTMs obtained (waiting on @mgartner)

@mgartner mgartner force-pushed the add-setting-for-new-stats-disjunction-improvements branch from 5877e03 to 8c011e3 Compare December 29, 2022 18:24
This commit adds the `optimizer_use_improved_disjunction_stats` session
setting that defaults to `true`. When `true`, the improved disjunction
logic added in cockroachdb#89358 is performed. When `false`, the logic reverts to
the previous logic. This setting will allow use to backport the new
logic without impacting query plans of running clusters by defaulting
the setting to false.

Release note: None
@mgartner mgartner force-pushed the add-setting-for-new-stats-disjunction-improvements branch from 8c011e3 to b1a2ce5 Compare December 29, 2022 19:33
@mgartner
Copy link
Copy Markdown
Contributor Author

TFTRs!

bors r+

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Dec 29, 2022

Build succeeded:

@craig craig bot merged commit e056b45 into cockroachdb:master Dec 29, 2022
@blathers-crl
Copy link
Copy Markdown

blathers-crl bot commented Dec 29, 2022

Encountered an error creating backports. Some common things that can go wrong:

  1. The backport branch might have already existed.
  2. There was a merge conflict.
  3. The backport branch contained merge commits.

You might need to create your backport manually using the backport tool.


error creating merge commit from b1a2ce5 to blathers/backport-release-22.1-94389: POST https://api.github.com/repos/cockroachdb/cockroach/merges: 409 Merge conflict []

you may need to manually resolve merge conflicts with the backport tool.

Backport to branch 22.1.x failed. See errors above.


error creating merge commit from b1a2ce5 to blathers/backport-release-22.2-94389: POST https://api.github.com/repos/cockroachdb/cockroach/merges: 409 Merge conflict []

you may need to manually resolve merge conflicts with the backport tool.

Backport to branch 22.2.x failed. See errors above.


🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is otan.

@mgartner mgartner deleted the add-setting-for-new-stats-disjunction-improvements branch December 29, 2022 22:29
mgartner added a commit to mgartner/cockroach that referenced this pull request Dec 29, 2022
These subtle bugs were discovered while creating cockroachdb#94439, the backport
of cockroachdb#89358 and cockroachdb#94389 to v22.1. They have already been included in that
backport. The backport to v22.2 has not yet been created, and it will
include this commit.

Release note: None
craig bot pushed a commit that referenced this pull request Jan 3, 2023
92327: backupccl: add tenant backup nemesis tests r=msbutler a=stevendanna

This adds a bit of randomized testing to stress incremental tenant backups.

Tenant backups were previously untenable because of non-MVCC operations. Now that we support MVCC-compatible bulk operations, they should in principal be possible.

Epic: CRDB-20264

Release note: None

94442: opt: fix minor mistakes in legacy disjunction stats logic r=mgartner a=mgartner

These subtle bugs were discovered while creating #94439, the backport
of #89358 and #94389 to v22.1. They have already been included in that
backport. The backport to v22.2 has not yet been created, and it will
include this commit.

Epic: None

Release note: None


Co-authored-by: Steven Danna <danna@cockroachlabs.com>
Co-authored-by: Marcus Gartner <marcus@cockroachlabs.com>
mgartner added a commit to mgartner/cockroach that referenced this pull request Jan 3, 2023
These subtle bugs were discovered while creating cockroachdb#94439, the backport
of cockroachdb#89358 and cockroachdb#94389 to v22.1. They have already been included in that
backport. The backport to v22.2 has not yet been created, and it will
include this commit.

Release note: None
mgartner added a commit to mgartner/cockroach that referenced this pull request Jan 4, 2023
These subtle bugs were discovered while creating cockroachdb#94439, the backport
of cockroachdb#89358 and cockroachdb#94389 to v22.1. They have already been included in that
backport. The backport to v22.2 has not yet been created, and it will
include this commit.

Release note: None
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants