-
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/catalog: reduce NameKey allocations #136234
Conversation
The `Catalog.LookupNamespaceEntry` method now accepts the concrete type `descpb.NameInfo` instead of the `catalog.NameKey` interface. This, along with future commits, will help reduce allocations. Release note: None
The `CatalogReader.IsNameInCache` method now accepts the concrete type `descpb.NameInfo` instead of the `catalog.NameKey` interface. This, along with other commits, will help reduce allocations. Release note: None
The `(*Collection).isShadowedName` method now accepts the concrete type `descpb.NameInfo` instead of the `catalog.NameKey` interface. This, along with other commits, will help reduce allocations. Release note: None
|
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! 0 of 0 LGTMs obtained (waiting on @mgartner)
pkg/sql/catalog/internal/catkv/system_database_cache.go
line 90 at r4 (raw file):
version clusterversion.ClusterVersion, key descpb.NameInfo, ) (descpb.ID, hlc.Timestamp) { // TODO: Refactor this a bit.
nit: can this comment provide a clue as to what we'd like to refactor?
Now that `(*SystemDatabaseCache).lookupDescriptorID` accepts a `descpb.NameInfo` parameter, it can access its exported field directly instead of using getters. Release note: None
2d6dbb6
to
725bebf
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.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @rafiss)
pkg/sql/catalog/internal/catkv/system_database_cache.go
line 90 at r4 (raw file):
Previously, rafiss (Rafi Shamim) wrote…
nit: can this comment provide a clue as to what we'd like to refactor?
Oops, that was a left-over comment. This commit already does the refactoring. Good catch!
TFTR! bors r+ |
sql/catalog: change
LookupNamespaceEntry
parameter typeThe
Catalog.LookupNamespaceEntry
method now accepts the concrete typedescpb.NameInfo
instead of thecatalog.NameKey
interface. This,along with future commits, will help reduce allocations.
Release note: None
sql/catalog: change
IsNameInCache
parameter typeThe
CatalogReader.IsNameInCache
method now accepts the concrete typedescpb.NameInfo
instead of thecatalog.NameKey
interface. This,along with other commits, will help reduce allocations.
Release note: None
sql/catalog: change
(*Collection).isShadowedName
parameter typeThe
(*Collection).isShadowedName
method now accepts the concrete typedescpb.NameInfo
instead of thecatalog.NameKey
interface. This,along with other commits, will help reduce allocations.
Informs #105867
Fixes #135905
Fixes #121300
Release note: None
sql/catalog: refactor
(*SystemDatabaseCache).lookupDescriptorID
Now that
(*SystemDatabaseCache).lookupDescriptorID
accepts adescpb.NameInfo
parameter, it can access its exported field directlyinstead of using getters.
Release note: None