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: add schema_name,table_id to crdb_internal.ranges #59865

Merged
merged 1 commit into from
Feb 16, 2021

Conversation

jordanlewis
Copy link
Member

@jordanlewis jordanlewis commented Feb 5, 2021

... and crdb_internal.ranges_no_leases

Closes #59601.

This commit adds schema_name to crdb_internal.ranges and
crdb_internal.ranges_no_leases to ensure that it's possible to
disambiguate between ranges that are contained by a table with the same
name in two different user-defined schemas.

In addition, it also adds the table_id column which allows unambiguous
lookups of ranges for a given table id. This will also enable making a
virtual index on the table_id column later, which should be a nice win
for some introspection commands.

Release note (sql change): add the schema_name and table_id columns to
the crdb_internal.ranges and crdb_internal.ranges_no_leases virtual
tables.

@cockroach-teamcity
Copy link
Member

This change is Reviewable

@jordanlewis jordanlewis force-pushed the include-schema-in-ranges branch 2 times, most recently from a8299a4 to e1c68ba Compare February 5, 2021 23:15
pkg/sql/crdb_internal.go Outdated Show resolved Hide resolved
... and crdb_internal.ranges_no_leases

This commit adds schema_name to crdb_internal.ranges and
crdb_internal.ranges_no_leases to ensure that it's possible to
disambiguate between ranges that are contained by a table with the same
name in two different user-defined schemas.

In addition, it also adds the table_id column which allows unambiguous
lookups of ranges for a given table id. This will also enable making a
virtual index on the table_id column later, which should be a nice win
for some introspection commands.

Release note (sql change): add the schema_name and table_id columns to
the crdb_internal.ranges and crdb_internal.ranges_no_leases virtual
tables.
@jordanlewis jordanlewis force-pushed the include-schema-in-ranges branch from e1c68ba to 6c4bccb Compare February 12, 2021 20:14
@jordanlewis
Copy link
Member Author

Done!

Copy link
Collaborator

@rafiss rafiss left a comment

Choose a reason for hiding this comment

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

lgtme!

@rafiss
Copy link
Collaborator

rafiss commented Feb 16, 2021

bors r+

@craig
Copy link
Contributor

craig bot commented Feb 16, 2021

Build succeeded:

@craig craig bot merged commit 959750d into cockroachdb:master Feb 16, 2021
@jordanlewis jordanlewis deleted the include-schema-in-ranges branch March 5, 2021 19:27
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.

sql: crdb_internal.ranges{,no_leases} does not interoperate correctly with user-defined schemas
3 participants