Include the database name and schema name in node_statement_statistics and jobs tables.
Is your feature request related to a problem? Please describe. When querying the node statement statistics table on the crdb_internal schema its impossible to tell which database or schema the query was run against easily. By adding the database and schema name to this table it would make it easier
Describe the solution you'd like Addition of columns detailing the database and schema the query is running against
Describe alternatives you've considered A very manual exercise that is not always correct
Additional context Raised by a customer
gz#5970
Jira issue: CRDB-3974
Hi @pxlogan, I've guessed the C-ategory of your issue and suitably labeled it. Please re-label if inaccurate.
While you're here, please consider adding an A- label to help keep our repository tidy.
:owl: Hoot! I am a Blathers, a bot for CockroachDB. My owner is otan.
Any update on the progress of this request?
@thtruo This issue has kind of gotten lost, but should be about observeability. Assigning to you for triage.
cc @kevin-v-ngo as it relates to SQL Observability / SQL Queries since this request is about making changes to node_statement_statistics
I'll assign to you for triage. Let me know if this ownership makes sense!
The next release will include the database name. This is the default database specified when connecting to cockroachdb. Here's the change.
@pxlogan, is this what you're looking for? As for schema, can you clarify the behavior you're looking for? If there is a query touching multiple schemas, what do you expect the behavior to be?
@kevin-v-ngo I dont think so, what I want in this probably displayed in either the first or second column is the name of the database in the cluster that the query was ran against. So that users can see which database is the busiest. This may not be the one they connect to necessarily.
Thanks. What about cross-database queries? For instance, a single query returning results from 2 databases. Which database do you expect to be displayed for the query?
Hi @pxlogan, can you elaborate on the cross-database query use case? Specifically, when there is a single query across two databases, what do you expect to be displayed?
@kevin-v-ngo an excellent question, I think if it is not possible to show multiple databases it should the database that the first table in the from clause of the query is located in.
We have marked this issue as stale because it has been inactive for 18 months. If this issue is still relevant, removing the stale label or adding a comment will keep it active. Otherwise, we'll close it in 10 days to keep the issue queue tidy. Thank you for your contribution to CockroachDB!