-
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.
cli: improve interactive sql shell timings
Previously, when a user executed multiple statements on a single line in the CLI, we would send the string as-is to the server. This would skew statement execution timings by attributing all of the server execution time to the first statement. This patch fixes this issue by parsing the supplied string on the client side and sending invididual statements one at a time. This is in line with Postgres behavior. Additionally, this patch also changes the way we calculate the time displayed by the CLI. Previously, we would show the time it took between a client sending a request and recieving a result. This would include the client-server latency as well. Now instead of showing the total time, we switch to showing just the server execution time. This is done by issuing the `SHOW LAST QUERY STATISTICS` query underneath the hood. Fixes #48180 Informs #49450 Release note (cli change): The way the CLI now shows the server execution timing instead of the total time it took to recieve results. This means factors such as rendering time and client server latency are no longer accounted for in the timings that the CLI prints for a query execution. Additionally, if multiple statements are supplied on a single line, the timings displayed now are a more accurate representation than before. Earlier the time displayed for the first statement included the processing time for all the statements supplied in that line. This is no longer the case as individual statement timings now represent only their execution times. This brings us in line with the postgres CLI.
- Loading branch information
1 parent
b54e948
commit ca0d5b2
Showing
2 changed files
with
48 additions
and
29 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