Skip to content

Commit

Permalink
Merge #40565
Browse files Browse the repository at this point in the history
40565: exec: make the output of explain(vec) more compact r=jordanlewis a=jordanlewis

The treeprinter was extended to learn about different indentation width,
and explain(vec) now uses a rather compact setting.

Release note: None

Co-authored-by: Jordan Lewis <jordanthelewis@gmail.com>
  • Loading branch information
craig[bot] and jordanlewis committed Sep 8, 2019
2 parents e186c66 + 426731a commit 9d7a3ae
Show file tree
Hide file tree
Showing 4 changed files with 494 additions and 461 deletions.
2 changes: 1 addition & 1 deletion pkg/sql/explain_vec.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ func (n *explainVecNode) startExec(params runParams) error {
}
// Sort backward, since the first thing you add to a treeprinter will come last.
sort.Slice(sortedFlows, func(i, j int) bool { return sortedFlows[i].nodeID < sortedFlows[j].nodeID })
tp := treeprinter.New()
tp := treeprinter.NewWithIndent(false /* leftPad */, true /* rightPad */, 0 /* edgeLength */)
root := tp.Child("")
verbose := n.options.Flags.Contains(tree.ExplainFlagVerbose)
for _, flow := range sortedFlows {
Expand Down
342 changes: 171 additions & 171 deletions pkg/sql/logictest/testdata/logic_test/dist_vectorize
Original file line number Diff line number Diff line change
Expand Up @@ -89,178 +89,178 @@ RESET optimizer
query T
EXPLAIN (VEC, VERBOSE) SELECT count(*) FROM kv
----
├── Node 1
│ └── *distsqlrun.materializer
└── *exec.orderedAggregator
└── *exec.oneShotOp
└── *exec.distinctChainOps
└── *exec.UnorderedSynchronizer
├── *exec.countOp
│ └── *exec.simpleProjectOp
└── *exec.CancelChecker
└── *distsqlrun.colBatchScan
├── *colrpc.Inbox
├── *colrpc.Inbox
├── *colrpc.Inbox
└── *colrpc.Inbox
├── Node 2
│ └── *colrpc.Outbox
└── *exec.deselectorOp
└── *exec.countOp
└── *exec.simpleProjectOp
└── *exec.CancelChecker
└── *distsqlrun.colBatchScan
├── Node 3
│ └── *colrpc.Outbox
└── *exec.deselectorOp
└── *exec.countOp
└── *exec.simpleProjectOp
└── *exec.CancelChecker
└── *distsqlrun.colBatchScan
├── Node 4
│ └── *colrpc.Outbox
└── *exec.deselectorOp
└── *exec.countOp
└── *exec.simpleProjectOp
└── *exec.CancelChecker
└── *distsqlrun.colBatchScan
└── Node 5
└── *colrpc.Outbox
└── *exec.deselectorOp
└── *exec.countOp
└── *exec.simpleProjectOp
└── *exec.CancelChecker
└── *distsqlrun.colBatchScan
Node 1
│ └ *distsqlrun.materializer
*exec.orderedAggregator
*exec.oneShotOp
*exec.distinctChainOps
*exec.UnorderedSynchronizer
*exec.countOp
│ └ *exec.simpleProjectOp
│ │ *exec.CancelChecker
│ │ *distsqlrun.colBatchScan
*colrpc.Inbox
*colrpc.Inbox
*colrpc.Inbox
*colrpc.Inbox
Node 2
│ └ *colrpc.Outbox
*exec.deselectorOp
*exec.countOp
*exec.simpleProjectOp
*exec.CancelChecker
*distsqlrun.colBatchScan
Node 3
│ └ *colrpc.Outbox
*exec.deselectorOp
*exec.countOp
*exec.simpleProjectOp
*exec.CancelChecker
*distsqlrun.colBatchScan
Node 4
│ └ *colrpc.Outbox
*exec.deselectorOp
*exec.countOp
*exec.simpleProjectOp
*exec.CancelChecker
*distsqlrun.colBatchScan
Node 5
*colrpc.Outbox
*exec.deselectorOp
*exec.countOp
*exec.simpleProjectOp
*exec.CancelChecker
*distsqlrun.colBatchScan

query T
EXPLAIN (VEC, VERBOSE) SELECT count(*) FROM kv NATURAL INNER HASH JOIN kv kv2
----
├── Node 1
│ └── *distsqlrun.materializer
└── *exec.orderedAggregator
└── *exec.oneShotOp
└── *exec.distinctChainOps
└── *exec.UnorderedSynchronizer
├── *exec.countOp
│ └── *exec.simpleProjectOp
└── *exec.hashJoinEqOp
├── *exec.UnorderedSynchronizer
│ ├── *exec.routerOutputOp
│ │ └── *exec.HashRouter
└── *exec.CancelChecker
└── *distsqlrun.colBatchScan
│ ├── *colrpc.Inbox
│ ├── *colrpc.Inbox
│ ├── *colrpc.Inbox
│ └── *colrpc.Inbox
└── *exec.UnorderedSynchronizer
├── *exec.routerOutputOp
│ └── *exec.HashRouter
└── *exec.CancelChecker
└── *distsqlrun.colBatchScan
├── *colrpc.Inbox
├── *colrpc.Inbox
├── *colrpc.Inbox
└── *colrpc.Inbox
├── *colrpc.Inbox
├── *colrpc.Inbox
├── *colrpc.Inbox
└── *colrpc.Inbox
├── Node 2
│ └── *colrpc.Outbox
└── *exec.deselectorOp
└── *exec.countOp
└── *exec.simpleProjectOp
└── *exec.hashJoinEqOp
├── *exec.UnorderedSynchronizer
│ ├── *colrpc.Inbox
│ ├── *exec.routerOutputOp
│ │ └── *exec.HashRouter
└── *exec.CancelChecker
└── *distsqlrun.colBatchScan
│ ├── *colrpc.Inbox
│ ├── *colrpc.Inbox
│ └── *colrpc.Inbox
└── *exec.UnorderedSynchronizer
├── *colrpc.Inbox
├── *exec.routerOutputOp
│ └── *exec.HashRouter
└── *exec.CancelChecker
└── *distsqlrun.colBatchScan
├── *colrpc.Inbox
├── *colrpc.Inbox
└── *colrpc.Inbox
├── Node 3
│ └── *colrpc.Outbox
└── *exec.deselectorOp
└── *exec.countOp
└── *exec.simpleProjectOp
└── *exec.hashJoinEqOp
├── *exec.UnorderedSynchronizer
│ ├── *colrpc.Inbox
│ ├── *colrpc.Inbox
│ ├── *exec.routerOutputOp
│ │ └── *exec.HashRouter
└── *exec.CancelChecker
└── *distsqlrun.colBatchScan
│ ├── *colrpc.Inbox
│ └── *colrpc.Inbox
└── *exec.UnorderedSynchronizer
├── *colrpc.Inbox
├── *colrpc.Inbox
├── *exec.routerOutputOp
│ └── *exec.HashRouter
└── *exec.CancelChecker
└── *distsqlrun.colBatchScan
├── *colrpc.Inbox
└── *colrpc.Inbox
├── Node 4
│ └── *colrpc.Outbox
└── *exec.deselectorOp
└── *exec.countOp
└── *exec.simpleProjectOp
└── *exec.hashJoinEqOp
├── *exec.UnorderedSynchronizer
│ ├── *colrpc.Inbox
│ ├── *colrpc.Inbox
│ ├── *colrpc.Inbox
│ ├── *exec.routerOutputOp
│ │ └── *exec.HashRouter
└── *exec.CancelChecker
└── *distsqlrun.colBatchScan
│ └── *colrpc.Inbox
└── *exec.UnorderedSynchronizer
├── *colrpc.Inbox
├── *colrpc.Inbox
├── *colrpc.Inbox
├── *exec.routerOutputOp
│ └── *exec.HashRouter
└── *exec.CancelChecker
└── *distsqlrun.colBatchScan
└── *colrpc.Inbox
└── Node 5
└── *colrpc.Outbox
└── *exec.deselectorOp
└── *exec.countOp
└── *exec.simpleProjectOp
└── *exec.hashJoinEqOp
├── *exec.UnorderedSynchronizer
│ ├── *colrpc.Inbox
│ ├── *colrpc.Inbox
│ ├── *colrpc.Inbox
│ ├── *colrpc.Inbox
│ └── *exec.routerOutputOp
└── *exec.HashRouter
└── *exec.CancelChecker
└── *distsqlrun.colBatchScan
└── *exec.UnorderedSynchronizer
├── *colrpc.Inbox
├── *colrpc.Inbox
├── *colrpc.Inbox
├── *colrpc.Inbox
└── *exec.routerOutputOp
└── *exec.HashRouter
└── *exec.CancelChecker
└── *distsqlrun.colBatchScan
Node 1
│ └ *distsqlrun.materializer
*exec.orderedAggregator
*exec.oneShotOp
*exec.distinctChainOps
*exec.UnorderedSynchronizer
*exec.countOp
│ └ *exec.simpleProjectOp
│ │ *exec.hashJoinEqOp
│ │ *exec.UnorderedSynchronizer
│ │ │ ├ *exec.routerOutputOp
│ │ │ │ └ *exec.HashRouter
│ │ *exec.CancelChecker
│ │ *distsqlrun.colBatchScan
│ │ │ ├ *colrpc.Inbox
│ │ │ ├ *colrpc.Inbox
│ │ │ ├ *colrpc.Inbox
│ │ │ └ *colrpc.Inbox
│ │ *exec.UnorderedSynchronizer
│ │ *exec.routerOutputOp
│ │ │ └ *exec.HashRouter
│ │ │ *exec.CancelChecker
│ │ │ *distsqlrun.colBatchScan
│ │ *colrpc.Inbox
│ │ *colrpc.Inbox
│ │ *colrpc.Inbox
│ │ *colrpc.Inbox
*colrpc.Inbox
*colrpc.Inbox
*colrpc.Inbox
*colrpc.Inbox
Node 2
│ └ *colrpc.Outbox
*exec.deselectorOp
*exec.countOp
*exec.simpleProjectOp
*exec.hashJoinEqOp
*exec.UnorderedSynchronizer
│ ├ *colrpc.Inbox
│ ├ *exec.routerOutputOp
│ │ └ *exec.HashRouter
*exec.CancelChecker
*distsqlrun.colBatchScan
│ ├ *colrpc.Inbox
│ ├ *colrpc.Inbox
│ └ *colrpc.Inbox
*exec.UnorderedSynchronizer
*colrpc.Inbox
*exec.routerOutputOp
│ └ *exec.HashRouter
│ │ *exec.CancelChecker
│ │ *distsqlrun.colBatchScan
*colrpc.Inbox
*colrpc.Inbox
*colrpc.Inbox
Node 3
│ └ *colrpc.Outbox
*exec.deselectorOp
*exec.countOp
*exec.simpleProjectOp
*exec.hashJoinEqOp
*exec.UnorderedSynchronizer
│ ├ *colrpc.Inbox
│ ├ *colrpc.Inbox
│ ├ *exec.routerOutputOp
│ │ └ *exec.HashRouter
*exec.CancelChecker
*distsqlrun.colBatchScan
│ ├ *colrpc.Inbox
│ └ *colrpc.Inbox
*exec.UnorderedSynchronizer
*colrpc.Inbox
*colrpc.Inbox
*exec.routerOutputOp
│ └ *exec.HashRouter
│ │ *exec.CancelChecker
│ │ *distsqlrun.colBatchScan
*colrpc.Inbox
*colrpc.Inbox
Node 4
│ └ *colrpc.Outbox
*exec.deselectorOp
*exec.countOp
*exec.simpleProjectOp
*exec.hashJoinEqOp
*exec.UnorderedSynchronizer
│ ├ *colrpc.Inbox
│ ├ *colrpc.Inbox
│ ├ *colrpc.Inbox
│ ├ *exec.routerOutputOp
│ │ └ *exec.HashRouter
*exec.CancelChecker
*distsqlrun.colBatchScan
│ └ *colrpc.Inbox
*exec.UnorderedSynchronizer
*colrpc.Inbox
*colrpc.Inbox
*colrpc.Inbox
*exec.routerOutputOp
│ └ *exec.HashRouter
│ │ *exec.CancelChecker
│ │ *distsqlrun.colBatchScan
*colrpc.Inbox
Node 5
*colrpc.Outbox
*exec.deselectorOp
*exec.countOp
*exec.simpleProjectOp
*exec.hashJoinEqOp
*exec.UnorderedSynchronizer
│ ├ *colrpc.Inbox
│ ├ *colrpc.Inbox
│ ├ *colrpc.Inbox
│ ├ *colrpc.Inbox
│ └ *exec.routerOutputOp
*exec.HashRouter
*exec.CancelChecker
*distsqlrun.colBatchScan
*exec.UnorderedSynchronizer
*colrpc.Inbox
*colrpc.Inbox
*colrpc.Inbox
*colrpc.Inbox
*exec.routerOutputOp
*exec.HashRouter
*exec.CancelChecker
*distsqlrun.colBatchScan
Loading

0 comments on commit 9d7a3ae

Please sign in to comment.