Skip to content

Add human-readable query identifiers in crdb_internal.statement_statistics and DB Console Statements page #91763

@florence-crl

Description

@florence-crl

Is your feature request related to a problem? Please describe.
In the DB Console SQL Activity->Statements page, there is no unique query identifier in the initial page. When you click into a query, you can see an identifier in the URL, such as http://127.0.0.1:26258/#/statement/true/4705782015019656142?appNames=

In this case 4705782015019656142 is the identifier. When querying crdb_internal.statement_statistics at the main table level there is no identifier that corresponds to 4705782015019656142. The only way to search for a query is using the metadata ->> ‘query’ clause like this:

where metadata ->> 'query' like '%SELECT city, id FROM vehicles WHERE city = $1%'

Sometimes if the full query text as shown in the console is entered, the filter will not find the given query string. You have to use some LIKE condition to find the query string. There are columns fingerprint_id and transaction_fingerprint_id in crdb_internal.statement_statistics but they are BYTE values that are not human-readable.

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

cc: @kevin-v-ngo

Jira issue: CRDB-21417

Metadata

Metadata

Assignees

Labels

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