-
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: expose KV range metadata to SQL for "experienced" admins #8990
Comments
Once this is available the SPLIT AT syntax can be simplified to take a simple |
@knz, please give me some more reference and I have time to fix it now. |
@knz , I start to fix this issue. about about |
For the first point you need to investigate the table/index descriptors. For the second point yes the solution will need LookupRange. |
@knz Now that we have |
No indeed |
This is a follow-up to #8938, a proposal to implement two new functions:
crdb_encode_pkey(table_or_index_name, expr...)
, returningbytea
, withtable_or_index_name
a string or identifier (string would be more easy and would create an opportunity to play with the virtual schema). This would compute and return the KV-level key encoding for the primary key of the specified table/index using the values given in the other arguments.crdb_current_range_bounds(pkey)
, wherepkey
is abytea
, returning a tuple of twobytea
, with the two values are the current known range bounds for the range containingpkey
.The two functions in combinations can then be used to estimate "distance" between two rows in a table, in the sense of whether they belong to the same range or not, and can be used as a follow-up to #8938 to check that a split requested with "ALTER TABLE ... SPLIT" was actually processed.
The function names are just proposals.
cc @mjibson
The text was updated successfully, but these errors were encountered: