stats: use table descriptors instead of IDs#68997
Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom Aug 17, 2021
Merged
stats: use table descriptors instead of IDs#68997craig[bot] merged 1 commit intocockroachdb:masterfrom
craig[bot] merged 1 commit intocockroachdb:masterfrom
Conversation
Member
f38b84e to
731389b
Compare
731389b to
d8847c7
Compare
rytaft
approved these changes
Aug 17, 2021
Collaborator
rytaft
left a comment
There was a problem hiding this comment.
Reviewed 26 of 26 files at r1, all commit messages.
Reviewable status:complete! 1 of 0 LGTMs obtained (waiting on @postamar)
pkg/sql/stats/automatic_stats.go, line 380 at r1 (raw file):
func (r *Refresher) NotifyMutation(table catalog.TableDescriptor, rowsAffected int) { if !AutomaticStatisticsClusterMode.Get(&r.st.SV) || !hasStatistics(table) { // Automatic stats are disabled.
nit: tweak comment to include your change
pkg/sql/stats/stats_cache.go, line 239 at r1 (raw file):
return false } if table.IsView() {
nit: you're already checking table.IsView() in the block above
d8847c7 to
7213dba
Compare
Author
|
Thanks for the reviews. I've applied the requested changes. bors r+ |
Contributor
|
Build failed: |
Previously, the sql stats package inferred various properties about a table from its ID, like if it is a system or a virtual table. However the table descriptor is usually readily or easily available, providing much richer information about a table than its ID. In particular, this allows us to stop collecting stats for views. Release note (sql change): table statistics are no longer collected for views.
7213dba to
7273596
Compare
Author
|
bors r+ Sorry for the noise, I'd checked in a stupid typo. |
Contributor
|
Build failed (retrying...): |
Contributor
|
Build succeeded: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously, the sql stats package inferred various properties about
a table from its ID, like if it is a system or a virtual table.
However the table descriptor is usually readily or easily available,
providing much richer information about a table than its ID.
In particular, this allows us to stop collecting stats for views.
Release note (sql change): table statistics are no longer collected
for views.