cockroach icon indicating copy to clipboard operation
cockroach copied to clipboard

Include the database name and schema name in node_statement_statistics and jobs tables.

Open pxlogan opened this issue 6 years ago • 10 comments

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

pxlogan avatar Jul 31 '20 13:07 pxlogan

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.

blathers-crl avatar Jul 31 '20 13:07 blathers-crl

Any update on the progress of this request?

pxlogan avatar May 07 '21 14:05 pxlogan

@thtruo This issue has kind of gotten lost, but should be about observeability. Assigning to you for triage.

BramGruneir avatar Jul 15 '21 14:07 BramGruneir

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!

thtruo avatar Jul 22 '21 18:07 thtruo

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 avatar Jul 26 '21 12:07 kevin-v-ngo

@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.

pxlogan avatar Jul 26 '21 12:07 pxlogan

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?

kevin-v-ngo avatar Jul 26 '21 17:07 kevin-v-ngo

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 avatar Aug 02 '21 14:08 kevin-v-ngo

@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.

pxlogan avatar Aug 02 '21 14:08 pxlogan

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!

github-actions[bot] avatar Sep 12 '23 11:09 github-actions[bot]