forked from cockroachdb/cockroach
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
25851: opt: support SHOW TRACE r=RaduBerinde a=RaduBerinde #### sql: move explain ResultColumns to sqlbase We are duplicating the information about the result columns returned by EXPLAIN statements (in sql and in opt/optbuilder). This change moves the definitions to sqlbase and uses them in both cases. Release note: None #### opt: support SHOW TRACE Adding optimizer support for SHOW TRACE statements. We use two operators, one for `SHOW TRACE FOR <query>` and one for `SHOW TRACE FOR SESSION`. They both use the same `ShowTraceOpDef` for the private. We don't add non-explain execbuilder tests because statement tracing doesn't work with the TestEngine implementation. This will be addressed in a subsequent PR. Release note: None Co-authored-by: Radu Berinde <radu@cockroachlabs.com>
- Loading branch information
Showing
25 changed files
with
444 additions
and
107 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
exec-raw | ||
CREATE TABLE xy (x INT PRIMARY KEY, y INT) | ||
---- | ||
|
||
exec nodist | ||
EXPLAIN (VERBOSE) SHOW TRACE FOR SELECT x FROM xy ORDER BY y | ||
---- | ||
Tree:string Field:string Description:string Columns:string Ordering:string | ||
show trace for · · ("timestamp", age, message, tag, loc, operation, span) · | ||
└── render · · (x) · | ||
│ render 0 x · · | ||
└── sort · · (x, y) +y | ||
│ order +y · · | ||
└── scan · · (x, y) · | ||
· table xy@primary · · | ||
· spans ALL · · | ||
|
||
exec nodist | ||
EXPLAIN (VERBOSE) SHOW COMPACT KV TRACE FOR SELECT x FROM xy ORDER BY y | ||
---- | ||
Tree:string Field:string Description:string Columns:string Ordering:string | ||
show trace for · · (age, message, tag, operation) · | ||
└── render · · (x) · | ||
│ render 0 x · · | ||
└── sort · · (x, y) +y | ||
│ order +y · · | ||
└── scan · · (x, y) · | ||
· table xy@primary · · | ||
· spans ALL · · | ||
|
||
exec nodist | ||
EXPLAIN (VERBOSE) SHOW EXPERIMENTAL_REPLICA TRACE FOR SELECT x FROM xy ORDER BY y | ||
---- | ||
Tree:string Field:string Description:string Columns:string Ordering:string | ||
replica trace · · ("timestamp", node_id, store_id, replica_id) · | ||
└── show trace for · · ("timestamp", age, message, tag, loc, operation, span) · | ||
└── render · · (x) · | ||
│ render 0 x · · | ||
└── sort · · (x, y) +y | ||
│ order +y · · | ||
└── scan · · (x, y) · | ||
· table xy@primary · · | ||
· spans ALL · · |
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.