Skip to content

Conversation

@mgartner
Copy link
Collaborator

@mgartner mgartner commented Mar 13, 2023

This commit adds the enable_create_stats_using_extremes session
setting which allows users to run CREATE STATISTICS .. USING EXTREMES
when enabled. It is disabled by default.

This commit also presents a "feature not supported" error when a user
tries to create partial statistics with a WHERE clause. This feature
has not yet been implemented.

Epic: CRDB-19449

Fixes #95233

Release note: None

@mgartner mgartner requested review from a team and michae2 March 13, 2023 15:35
@mgartner mgartner requested a review from a team as a code owner March 13, 2023 15:35
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Collaborator

@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.

:lgtm: Thank you!

(Looks like some logic tests need to be rewritten.)

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


pkg/sql/logictest/testdata/logic_test/distsql_stats line 2008 at r1 (raw file):


statement ok
SET enable_create_stats_using_extremes = on

I think this will also need to be enabled in pkg/sql/opt/exec/execbuilder/testdata/partial_stats.

This commit adds the `enable_create_stats_using_extremes` session
setting which allows users to run `CREATE STATISTICS .. USING EXTREMES`
when enabled. It is disabled by default.

This commit also presents a "feature not supported" error when a user
tries to create partial statistics with a `WHERE` clause. This feature
has not yet been implemented.

Epic: CRDB-19449

Release note: None
@mgartner mgartner force-pushed the 95233-partial-stats-settings branch from 80383de to 240ad78 Compare March 13, 2023 20:29
@mgartner mgartner requested a review from a team as a code owner March 13, 2023 20:29
@mgartner mgartner requested review from benbardin and removed request for a team March 13, 2023 20:29
Copy link
Collaborator 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.

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


pkg/sql/logictest/testdata/logic_test/distsql_stats line 2008 at r1 (raw file):

Previously, michae2 (Michael Erickson) wrote…

I think this will also need to be enabled in pkg/sql/opt/exec/execbuilder/testdata/partial_stats.

It's actually not needed because we inject partial stats there instead of running CREATE STATISTICS .. USING EXTREMES.

@mgartner
Copy link
Collaborator Author

TFTRs!

bors r+

@craig
Copy link
Contributor

craig bot commented Mar 13, 2023

Build failed (retrying...):

@craig
Copy link
Contributor

craig bot commented Mar 14, 2023

Build succeeded:

@craig craig bot merged commit 74f993a into cockroachdb:master Mar 14, 2023
@mgartner mgartner deleted the 95233-partial-stats-settings branch March 14, 2023 13:23
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.

sql/stats: add variables to disable partial statistics merging and usage

3 participants