Skip to content

Commit

Permalink
exec: make the output of explain(vec) more compact
Browse files Browse the repository at this point in the history
The treeprinter was extended to learn about different indentation width,
and explain(vec) now uses a rather compact setting.

Release note: None
  • Loading branch information
jordanlewis committed Sep 7, 2019
1 parent 1ad55c5 commit ab1f384
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 ab1f384

Please sign in to comment.