Skip to content

sql: introduce shorthand to retrieve sql keys for a given range #54975

@irfansharif

Description

@irfansharif

Is your feature request related to a problem? Please describe.

During support calls we've frequently seen the need to go from a know problematic range to the SQL table/index/database corresponding to that range. We end up stitching together usage of SHOW RANGES to narrow down which keys a given range contains. We also consult the start/end keys of a given range to narrow down the specific table ID in question (/234/<...) and then look to find the table name, and so on.

Describe the solution you'd like

It'd be very useful to have a readily usable helper/query to quickly go from range ID to the SQL keyspace in question. It would shorten the debug loop by removing the tedious and error-prone manual steps needed to go from range ID to rows of interest. Straw man proposal (pulled out of thin air, almost definitely not what we want):

SHOW DATA FOR RANGE <range id>;
     database     |          table/index           | key (not the raw MVCC key, a SQL key that I can readily use)
+-----------------+--------------------------------+-------------------------------------------------------------+
  ...

Describe alternatives you've considered

N/A

Additional context

N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-sql-builtinsSQL built-in functions and semantics thereof.A-sql-encodingRelating to the SQL/KV encoding.C-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions