Skip to content

sql: add schema_name,table_id to crdb_internal.ranges#59865

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
jordanlewis:include-schema-in-ranges
Feb 16, 2021
Merged

sql: add schema_name,table_id to crdb_internal.ranges#59865
craig[bot] merged 1 commit intocockroachdb:masterfrom
jordanlewis:include-schema-in-ranges

Conversation

@jordanlewis
Copy link
Copy Markdown
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
Copy Markdown
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
... 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
Copy Markdown
Member Author

Done!

Copy link
Copy Markdown
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
Copy Markdown
Collaborator

rafiss commented Feb 16, 2021

bors r+

@craig
Copy link
Copy Markdown
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