-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
sql: always collect stats after a table is created #37611
Conversation
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 @justinj and @RaduBerinde)
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! 2 of 0 LGTMs obtained (waiting on @justinj)
Prior to this commit, we only collected automatic statistics on a CREATE TABLE statement if it was of the form CREATE TABLE AS <query>. To avoid inconsistencies, this commit changes the logic so we always create statistics on every successful CREATE TABLE statement. Fixes cockroachdb#37362 Release note (sql change): CREATE TABLE statements now always trigger automatic statistics collection on the newly created table.
TFTRs! bors r+ |
37611: sql: always collect stats after a table is created r=rytaft a=rytaft Prior to this commit, we only collected automatic statistics on a `CREATE TABLE` statement if it was of the form `CREATE TABLE AS <query>`. To avoid inconsistencies, this commit changes the logic so we always create statistics on every successful `CREATE TABLE` statement. Fixes #37362 Release note (sql change): CREATE TABLE statements now always trigger automatic statistics collection on the newly created table. Co-authored-by: Rebecca Taft <[email protected]>
Build succeeded |
Prior to this commit, we only collected automatic statistics on a
CREATE TABLE
statement if it was of the formCREATE TABLE AS <query>
.To avoid inconsistencies, this commit changes the logic so we always
create statistics on every successful
CREATE TABLE
statement.Fixes #37362
Release note (sql change): CREATE TABLE statements now always trigger automatic
statistics collection on the newly created table.