-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
96396: sqlstats, sql: add latency info to statement statistics r=maryliag a=maryliag This commits adds latency info in seconds to the statement statistics on `crdb_internal.statement_statistics`, `system.statement_statistics` and `crdb_internal.cluster_statement_statistics`, with information about: min, max, p50, p90 and p99. It also adds to `crdb_internal.node_statement_statistics` the columns: `latency_seconds_min`, `latency_seconds_max`, `latency_seconds_p50`, ` latency_seconds_p90` and `latency_seconds_p99`. Part Of #72954 This initial version is leveraging the latency summary that already existed on Insights. Since we were already collecting that information for all statements that executed for at least `AnomalyDetectionLatencyThreshold`, this commit makes that mapping available so SQLStats can use it to retrieve the values. This value is an estimate, since we're missing the executions that took less than the 50ms (default). We were also collecting just for p50, p90 and p99, so the function that returns the values adds that limitation, in case someone else was trying to use that function to retrieve other percentiles. A following task will focus on making this information more complete. Example of statistics column on a `SELECT pg_sleep(x)` with various values of x between 0.1 and 3: ``` { "execution_statistics": { ... }, "index_recommendations": [], "statistics": { ... "latencyInfo": { "max": 3.050540917, "min": 0.101273666, "p50": 0.600609374, "p90": 1.000914625, "p99": 3.001826416 }, } } ``` Example of new columns on node table: ``` ... latency_seconds_min | 0.201089583 latency_seconds_max | 3.200554126 latency_seconds_p50 | 0.700803875 latency_seconds_p90 | 1.501616292 latency_seconds_p99 | 3.200554126 ``` Release note (sql change): Add latency info (min, max, p50, p90, p99) to crdb_internal.statement_statistics, system.statement_statistics and crdb_internal.cluster_statement_statistics. Also adds `latency_seconds_min`, `latency_seconds_max`, `latency_seconds_p50`, `latency_seconds_p90` and `latency_seconds_p99` to crdb_internal.node_statement_statistics. Co-authored-by: maryliag <[email protected]>
- Loading branch information
Showing
23 changed files
with
408 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.