Skip to content

sql/opt: add session setting to disable stats forecast use in optimizer#86834

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
michae2:optuseforecasts
Aug 26, 2022
Merged

sql/opt: add session setting to disable stats forecast use in optimizer#86834
craig[bot] merged 1 commit intocockroachdb:masterfrom
michae2:optuseforecasts

Conversation

@michae2
Copy link
Copy Markdown
Collaborator

@michae2 michae2 commented Aug 24, 2022

Add a new session setting, optimizer_use_forecasts, which can be used
to disable forecast usage in the optimizer. Forecasts will still be
generated in the stats cache (this will be controlled by a different
setting).

Assists: #86350

Release justification: Low-risk update to new functionality.

Release note (sql change): This commit adds a new session setting,
optimizer_use_forecasts, which can be set to false to disable usage of
statistics forecasts when optimizing a query.

@michae2 michae2 requested review from a team, cucaroach, mgartner and rytaft August 24, 2022 23:23
@michae2 michae2 requested a review from a team as a code owner August 24, 2022 23:23
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

@michae2
Copy link
Copy Markdown
Collaborator Author

michae2 commented Aug 24, 2022

Note that the first two commits are #86634 and can be ignored.

Copy link
Copy Markdown
Collaborator

@rytaft rytaft left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 16 of 16 files at r1, all commit messages.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @cucaroach, @mgartner, and @michae2)


pkg/sql/logictest/testdata/logic_test/crdb_internal line 788 at r1 (raw file):

# Ensure that there are no longer any splits left over on the original indexes.
# TRUNCATE will have created equivalent splits points on the new indexes, so
# this test just checks that there are no more on the old indexes.

Does this comment need an update?

@michae2 michae2 force-pushed the optuseforecasts branch 2 times, most recently from cc456c9 to 4b2b1a2 Compare August 26, 2022 06:04
@michae2 michae2 changed the title sql/opt: add session variable to disable stats forecast use in optimizer sql/opt: add session setting to disable stats forecast use in optimizer Aug 26, 2022
Copy link
Copy Markdown
Collaborator Author

@michae2 michae2 left a comment

Choose a reason for hiding this comment

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

TFTR!

bors r=rytaft

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (and 1 stale) (waiting on @cucaroach, @mgartner, and @rytaft)


pkg/sql/logictest/testdata/logic_test/crdb_internal line 788 at r1 (raw file):

Previously, rytaft (Rebecca Taft) wrote…

Does this comment need an update?

Ah, this snuck in from a ./dev testlogic --config=local --rewrite. I've reverted it. (I think the retry hides the flakiness?)

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Aug 26, 2022

Build failed (retrying...):

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Aug 26, 2022

Build failed (retrying...):

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Aug 26, 2022

Build failed:

Add a new session setting, `optimizer_use_forecasts`, which can be used
to disable forecast usage in the optimizer. Forecasts will still be
generated in the stats cache (this will be controlled by a different
setting).

Assists: cockroachdb#86350

Release justification: Low-risk update to new functionality.

Release note (sql change): This commit adds a new session setting,
`optimizer_use_forecasts`, which can be set to false to disable usage of
statistics forecasts when optimizing a query.
@michae2
Copy link
Copy Markdown
Collaborator Author

michae2 commented Aug 26, 2022

"Cannot find commit" hmm. Let's try this again with a rebase.

bors r=rytaft

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Aug 26, 2022

Build failed (retrying...):

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Aug 26, 2022

Build failed (retrying...):

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Aug 26, 2022

Build succeeded:

@michae2 michae2 deleted the optuseforecasts branch August 27, 2022 04:28
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.

3 participants