-
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
opt: avoid looking up MultiregionConfig for non-multiregion tables #89590
Conversation
f99a10f
to
fe1580c
Compare
Nice find! I know this is a draft, but probably worth mentioning anyway that you could solve this more simply by making the error global like Yahor did here, since the error is always the same. Do you think any of the other assertions in that file are worth optimizing? |
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.
Thanks. The observation here is that there is no point in attempting to look up the multiregion config if we know ahead of time a table is not a multiregion table because none will ever be found. This would apply even if the error were made global.
Reviewable status: complete! 0 of 0 LGTMs obtained
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.
Reviewed 6 of 6 files at r1, all commit messages.
Reviewable status: complete! 1 of 0 LGTMs obtained (waiting on @msirek and @yuzefovich)
pkg/sql/opt/table_meta.go
line 515 at r1 (raw file):
}() if dbID == 0 || !tm.Table.IsMultiregion() { return descpb.SurvivalGoal_ZONE_FAILURE /* regionNames */, false
regionNames -> survivalGoal (or just get rid of this comment -- doesn't seem necessary)
fe1580c
to
0a31ada
Compare
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.
TFTR!
bors r=rytaft
Reviewable status: complete! 0 of 0 LGTMs obtained (and 1 stale) (waiting on @rytaft and @yuzefovich)
pkg/sql/opt/table_meta.go
line 515 at r1 (raw file):
Previously, rytaft (Rebecca Taft) wrote…
regionNames -> survivalGoal (or just get rid of this comment -- doesn't seem necessary)
Removed the comment
Build failed (retrying...): |
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.
bors r-
Reviewable status: complete! 0 of 0 LGTMs obtained (and 1 stale) (waiting on @rytaft and @yuzefovich)
Canceled. |
0a31ada
to
c6779df
Compare
This avoids expensive lookups of the regions in a table's parent database for non-multiregion tables. Release note: None
c6779df
to
030204c
Compare
bors r=rytaft |
Build succeeded: |
This avoids expensive lookups of the regions in a table's parent database for non-multiregion tables.
Epic: CRDB-18645
Release note: None