Skip to content
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: introduce index_recommendations_enabled session variable #73346

Merged
merged 1 commit into from Dec 16, 2021

Conversation

nehageorge
Copy link

@nehageorge nehageorge commented Dec 1, 2021

This commit introduces a session variable to control whether or not index
recommendations are shown at the bottom of the EXPLAIN plan. If
index_recommendations_enabled is set to true, index recommendations
are shown. Otherwise, they are not shown. This variable defaults to true.

Release note (sql change): Index recommendations can be omitted from
the EXPLAIN plan if the index_recommendations_enabled session variable
is set to false.

NOTE: This PR only concerns the final commit. Other commits will be reviewed and merged separately.

@nehageorge nehageorge requested a review from a team as a code owner December 1, 2021 20:29
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
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.

Reviewed 6 of 6 files at r1, 4 of 4 files at r2, 25 of 57 files at r3, 10 of 10 files at r4, all commit messages.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @nehageorge and @rytaft)


-- commits, line 46 at r4:
nit: feels like it would be more natural (and more consistent with other settings) to call this index_recommendations_enabled and have it default to true. (I see we have a couple of settings that do start with disable, but I think that was a mistake)

Copy link
Author

@nehageorge nehageorge 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! 0 of 0 LGTMs obtained (waiting on @rytaft)


-- commits, line 46 at r4:

Previously, rytaft (Rebecca Taft) wrote…

nit: feels like it would be more natural (and more consistent with other settings) to call this index_recommendations_enabled and have it default to true. (I see we have a couple of settings that do start with disable, but I think that was a mistake)

Makes sense. Done.

@nehageorge nehageorge changed the title sql: introduce disable_index_recommendations session variable sql: introduce index_recommendations_enabled session variable Dec 1, 2021
Copy link
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.

last commit :lgtm:

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

This commit introduces a session variable to control whether or not index
recommendations are shown at the bottom of the EXPLAIN plan. If
`index_recommendations_enabled` is set to true, index recommendations
are shown. Otherwise, they are not shown. This variable defaults to true.

Release note (sql change): Index recommendations can be omitted from
the EXPLAIN plan if the `index_recommendations_enabled` session variable
is set to false.
Copy link
Collaborator

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

Reviewed 5 of 10 files at r5, 65 of 65 files at r6, all commit messages.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (and 1 stale) (waiting on @nehageorge)

@mgartner
Copy link
Collaborator

I wonder if we want a cluster setting so users can turn it off for all sessions.

@rytaft
Copy link
Collaborator

rytaft commented Dec 15, 2021

I wonder if we want a cluster setting so users can turn it off for all sessions.

I think we're moving away from the sql.defaults cluster settings due to issues with supporting them for multi-tenancy. @RaduBerinde can probably give more context.

Copy link
Author

@nehageorge nehageorge left a comment

Choose a reason for hiding this comment

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

Good point @mgartner. Do you think it would make sense to have both a cluster setting and a session setting?

@nehageorge
Copy link
Author

I wonder if we want a cluster setting so users can turn it off for all sessions.

I think we're moving away from the sql.defaults cluster settings due to issues with supporting them for multi-tenancy. @RaduBerinde can probably give more context.

Disregard my most recent comment as per this comment.

@nehageorge
Copy link
Author

TFTRs!

bors r+

@RaduBerinde
Copy link
Member

I wonder if we want a cluster setting so users can turn it off for all sessions.

I think we're moving away from the sql.defaults cluster settings due to issues with supporting them for multi-tenancy. @RaduBerinde can probably give more context.

Not really multitenancy related, we're just adding infrastructure for setting per-role or per-db defaults for session settings, which makes these cluster settings unnecessary.

@craig
Copy link
Contributor

craig bot commented Dec 15, 2021

Build failed (retrying...):

@mgartner
Copy link
Collaborator

Not really multitenancy related, we're just adding infrastructure for setting per-role or per-db defaults for session settings, which makes these cluster settings unnecessary.

Makes sense. Let's merge this as-is, and @nehageorge can make an issue to track making a per-db/role default for this setting once the infrastructure is in place.

@craig
Copy link
Contributor

craig bot commented Dec 16, 2021

Build succeeded:

@nehageorge
Copy link
Author

Created an issue for the future per-role/per-db setting here: #73918.

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.

None yet

5 participants