-
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
catalog: improve how TableColMap handles system columns #72676
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.
Cool change!
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @ajwerner, @jordanlewis, and @yuzefovich)
pkg/sql/catalog/table_col_map.go, line 30 at r1 (raw file):
type TableColMap struct { m util.FastIntMap // systemColMap maps all system columns to their values. Columns here are
I think a unit test for this structure is warranted now.
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 @ajwerner, @jordanlewis, and @yuzefovich)
Previously, `TableColMap` would very often incur an allocation when mapping from system columns are set (because system columns have very large IDs). This commit teaches `TableColMap` to handle the system columns separately which allows us to remove those allocations. Release note: None
147b4c9
to
812551a
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+
Reviewable status: complete! 0 of 0 LGTMs obtained (and 1 stale) (waiting on @ajwerner, @jordanlewis, and @RaduBerinde)
pkg/sql/catalog/table_col_map.go, line 30 at r1 (raw file):
Previously, RaduBerinde wrote…
I think a unit test for this structure is warranted now.
Good point, added. This actually revealed a minor bug in String
implementation (forgetting to use spaces between mapping of system columns).
Build succeeded: |
Previously,
TableColMap
would very often incur an allocation whenmapping from system columns are set (because system columns have very
large IDs). This commit teaches
TableColMap
to handle the systemcolumns separately which allows us to remove those allocations.
Release note: None