Detecting Slow Sql Queries

Hi All,

Is there a way to find slow performing SQL - using system performance tables rather than the CockRoach UI ?

Parminder.

Hi @parminder,

Welcome to Cockroach Forum!

Sorry for the delay in response.

You can find slow performing SQL using the system performance tables rather than the Admin UI Statements page (https://adminui/#/statements) using the query below:

select key as "STATEMENT",
implicit_txn as "TXN TYPE",
count::float * service_lat_avg as "TIME",
count as "EXECUTION COUNT",
max_retries as "RETRIES",
rows_avg as "ROWS AFFECTED",
service_lat_avg as "LATENCY"
from crdb_internal.node_statement_statistics
order by "TIME" desc;

Please let me know if you have any questions.

Regards,
Florence
Technical Support Engineer

Hi Florence,

Exactly what I needed, plus I found a whole heap of other useful tables !

Regards,
Parminder.