-
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.
54741: cli: support `-f` to read SQL from a file r=irfansharif a=knz Fixes #42955 Release note (cli change): `cockroach sql` and `cockroach demo` now support the command-line parameter `--input-file` (shorthand `-f`) to read commands from a named file. The behavior is the same as if the file was redirected on the standard input; in particular, the processing stops at the first error encountered (which is different from interactive usage with a prompt). Note that it is not (yet) possible to combine `-f` with `-e`. 54751: cli/sql: further polish statement statistics r=irfansharif,arulajmani,jordanlewis,awoods187,bdarnell,jseldess,RaduBerinde,Annebirzin,ricardocrdb a=knz The following rules are applied: - the breakdown is only displayed if the total execution time exceeds 1ms. We assume that (human) users don't care about the breakdown if a statement is faster than that. - if `verbose_timings` is unset (default), the server-side latencies are all grouped together (the "service latency") under a single `execution` label. - the user can invoke `\set verbose_timings` to get the full breakdown. Example outputs follow. The breakdown is omitted because the total time is under 1ms: ``` [email protected]:44820/defaultdb> select 1; ?column? ------------ 1 (1 row) Time: 0.000s total ``` A query is simple to parse/plan, but takes a while to execute because it produces a lot of data: ``` [email protected]:44820/defaultdb> select generate_series(1,10000); ... (10000 rows) Time: 0.013s total (execution 0.004s / network 0.009s) ``` A more complex statement: ``` [email protected]:44820/defaultdb> create table t(x int); CREATE TABLE Time: 0.003s total (execution 0.002s / network 0.001s) ``` Release note (cli change): The display of statement timings in the SQL shell (`cockroach sql` and `cockroach demo`) has been further simplified. Co-authored-by: Raphael 'kena' Poss <[email protected]>
- Loading branch information
Showing
13 changed files
with
175 additions
and
55 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
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.