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: use schema desc ID for OIDs in vtables #90793

Merged
merged 1 commit into from
Oct 29, 2022

Conversation

rafiss
Copy link
Collaborator

@rafiss rafiss commented Oct 27, 2022

The OIDs for schemas in the information_schema and pg_catalog tables are all now the same as the descriptor ID. For virtual schemas, the IDs are hardcoded.

No release note since OIDs are not really meant to be used externally, and we've changed these in the past without fanfare.

Release note: None
Epic: None

@rafiss rafiss requested review from ajwerner and a team October 27, 2022 19:13
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Contributor

@ajwerner ajwerner left a comment

Choose a reason for hiding this comment

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

I guess this just works, doesn't it? That's great. At first I was thinking it was bad that the virtual schemas in different databases have the same OID, but OIDs are database-scoped in pg_catalog, so it's fine, right?

Will this mean we can more or less trivially add an index on pg_namespace?

Reviewed all commit messages.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained

@rafiss
Copy link
Collaborator Author

rafiss commented Oct 27, 2022

OIDs are database-scoped in pg_catalog, so it's fine, right?

that was my thought as well. it should just work!

Will this mean we can more or less trivially add an index on pg_namespace?

yeah. my motivation was to fix the perf problem i ran into in #90649

@rafiss rafiss force-pushed the schema-oids branch 4 times, most recently from 81172fe to f774b89 Compare October 28, 2022 04:54
The OIDs for schemas in the information_schema and pg_catalog
tables are all now the same as the descriptor ID. For virtual
schemas, the IDs are hardcoded.

No release note since OIDs are not really meant to be used externally,
and we've changed these in the past without fanfare.

Release note: None
@rafiss
Copy link
Collaborator Author

rafiss commented Oct 28, 2022

bors r=ajwerner

@rafiss
Copy link
Collaborator Author

rafiss commented Oct 28, 2022

bors r+

@craig
Copy link
Contributor

craig bot commented Oct 28, 2022

Already running a review

@craig
Copy link
Contributor

craig bot commented Oct 28, 2022

Build failed (retrying...):

@craig
Copy link
Contributor

craig bot commented Oct 29, 2022

Build succeeded:

@craig craig bot merged commit 0c1c3e7 into cockroachdb:master Oct 29, 2022
@rafiss rafiss deleted the schema-oids branch October 29, 2022 07:57
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.

3 participants