Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
server: fix total latency time on sql stats call
For the top activity tables, we have a column `execution_total_cluster_seconds` with the total latency of all executions of that period. This value is important because the top activity table have up to 500 rows per aggregated timestamp, so if we add all latencies from it, we won't have the total, only the total of the top. We then have a column that has that total of that hour which is based on the main table. Previously, when making a request to the top activity table we were returning only of of those values as the total, which works as expected if your select is in a single aggregation period. The majority of requests won't be this way, so we need to add the values from all aggregated period selects. This commit update the query for the total select to get one value from each aggregated_ts and then adding those. Part Of CRDB-34884 Release note (bug fix): Fix value used for the total runtime on sql stats, which was using the wrong value previously, causing the UI to display values with more than 100%.
- Loading branch information