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.
Browse files
Browse the repository at this point in the history
70441: importccl: fix test for duplicate collated string primary keys r=rhu713 a=rhu713 Previously the test for duplicate collated string primary keys had an incorrectly formed CSV as the test data. This change fixes the test data by adding the collation to all of the rows in the CSV. Release note: None 70540: build: fix incorrect argument name when checking container memory limits r=AlexTalks a=AlexTalks This change fixes a typo where when checking if a build failed due to the Docker container memory limits being too low, the script checked for `xmkrelease` instead of `mkrelease`. This caused developers to potentially fail builds (for example, with MacOS Docker resource defaults) without realizing the reason why. Release note: None 70568: cluster-ui: add tooltips to explain plan r=Azhng,maryliag,matthewtodd a=xinhaoz Resolves: cockroachdb#61764 This commit adds tooltips to explain plan operators and node attributes, providing more information to explain plans. Release justification: low-risk, high benefit changes to existing functionality Release note (ui change): On the explain plan tab in statement details, Users will be able to hover over underlined explain plan attributes to get tooltips with more information on the attribute. ----------------------------------------------------------------------- ![image](https://user-images.githubusercontent.com/20136951/134358090-02d05792-9edb-4820-b476-41ab06d84282.png) ![image](https://user-images.githubusercontent.com/20136951/134358143-a75889d4-e300-4e5f-b42f-46a686f4fd70.png) Co-authored-by: Rui Hu <[email protected]> Co-authored-by: Alex Sarkesian <[email protected]> Co-authored-by: Xin Hao Zhang <[email protected]>
- Loading branch information
Showing
7 changed files
with
518 additions
and
304 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
156 changes: 156 additions & 0 deletions
156
pkg/ui/workspaces/cluster-ui/src/statementDetails/planView/planTooltips.tsx
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,156 @@ | ||
// Copyright 2021 The Cockroach Authors. | ||
// | ||
// Use of this software is governed by the Business Source License | ||
// included in the file licenses/BSL.txt. | ||
// | ||
// As of the Change Date specified in that file, in accordance with | ||
// the Business Source License, use of this software will be governed | ||
// by the Apache License, Version 2.0, included in the file | ||
// licenses/APL.txt. | ||
|
||
import React from "react"; | ||
import { Anchor } from "src/anchor"; | ||
import { | ||
distSql, | ||
vectorizedExecution, | ||
mergeJoin, | ||
lookupJoin, | ||
hashJoin, | ||
invertedJoin, | ||
indexJoin, | ||
fullScan, | ||
secondaryIndex, | ||
lockingStrength, | ||
transactionLayerOverview, | ||
} from "src/util/docs"; | ||
|
||
type TooltipMap = Record<string, JSX.Element>; | ||
|
||
const attributeTooltips: TooltipMap = { | ||
autoCommit: ( | ||
<span> | ||
All statements are handled as transactions.{" "} | ||
<Anchor href={transactionLayerOverview}>Autocommit</Anchor> indicates that | ||
the single statement was implicitly committed. | ||
</span> | ||
), | ||
distribution: ( | ||
<span> | ||
CockroachDB supports{" "} | ||
<Anchor href={distSql}>two modes of execution </Anchor> | ||
for SQL queries: local and distributed. In local execution, data is pulled | ||
from where it is towards the one node that does the processing. In | ||
distributed execution, the processing is shipped to run close to where the | ||
data is stored, usually on multiple nodes simultaneously. | ||
</span> | ||
), | ||
lockingStrength: ( | ||
<span> | ||
<Anchor href={lockingStrength}>Locking strength</Anchor> indicates that | ||
additional locks were applied to rows during execution to improve | ||
performance for workloads having high contention. | ||
</span> | ||
), | ||
vectorized: ( | ||
<span> | ||
CockroachDB supports a{" "} | ||
<Anchor href={vectorizedExecution}>vectorized execution engine.</Anchor> | ||
</span> | ||
), | ||
}; | ||
|
||
const operatorTooltips: TooltipMap = { | ||
filter: ( | ||
<span> | ||
The filter operator indicates the statement contains a WHERE clause. | ||
</span> | ||
), | ||
group: ( | ||
<span> | ||
The group operator indicates the statement contains a GROUP BY clause. | ||
</span> | ||
), | ||
hashJoin: ( | ||
<span> | ||
<Anchor href={hashJoin}>Hash join</Anchor> is used when merge join cannot | ||
be used. CockroachDB will create a hash table based on the smaller table | ||
and then scan the larger table, looking up each row in the hash table. | ||
</span> | ||
), | ||
indexJoin: ( | ||
<span> | ||
<Anchor href={indexJoin}>Index join</Anchor> is suboptimal and indicates a | ||
non-covering index where not all columns are present in the index to | ||
satisfy the query. Index join requires columns to additionally be read | ||
from the primary index. | ||
</span> | ||
), | ||
insertFastPath: ( | ||
<span>The insert operator indicates an INSERT statement.</span> | ||
), | ||
invertedJoin: ( | ||
<span> | ||
<Anchor href={invertedJoin}>Inverted join</Anchor> forces the optimizer to | ||
use a join using an inverted index on the right side of the join. Inverted | ||
joins can only be used with INNER and LEFT joins. | ||
</span> | ||
), | ||
lookupJoin: ( | ||
<span> | ||
<Anchor href={lookupJoin}>Lookup join</Anchor> is used where there is a | ||
large imbalance in size between the tables. The larger table must be | ||
indexed on the equality column. Each row in the small table is read where | ||
the rows are 'looked up' in the larger table for matches. | ||
</span> | ||
), | ||
mergeJoin: ( | ||
<span> | ||
<Anchor href={mergeJoin}>Merge join</Anchor> is selected when both tables | ||
are indexed on the equality columns where indexes must have the same | ||
ordering. | ||
</span> | ||
), | ||
scan: ( | ||
<span> | ||
The scan (or reverse scan) operator indicates which and how the table(s) | ||
in the statement's FROM clause and its index is read. | ||
</span> | ||
), | ||
sort: ( | ||
<span> | ||
The sort operator indicates the statement contains an ORDER BY clause. | ||
</span> | ||
), | ||
update: <span>The update operator indicates an UPDATE statement.</span>, | ||
window: ( | ||
<span> | ||
The window operator indicates the statement contains a OVER or WINDOW | ||
clause for window functions. | ||
</span> | ||
), | ||
}; | ||
|
||
const attributeValueTooltips: TooltipMap = { | ||
fullScan: ( | ||
<span> | ||
A <Anchor href={fullScan}>FULL SCAN</Anchor> indicates that{" "} | ||
<strong>all</strong> rows were read from the table index. | ||
<br /> | ||
<strong>Recommendation:</strong> Consider{" "} | ||
<Anchor href={secondaryIndex}>adding a secondary index</Anchor> to the | ||
table if the FULL SCAN is retrieving a relatively large number of rows. | ||
</span> | ||
), | ||
}; | ||
|
||
export function getOperatorTooltip(key: string): React.ReactElement { | ||
return operatorTooltips[key] || null; | ||
} | ||
|
||
export function getAttributeTooltip(key: string): JSX.Element { | ||
return attributeTooltips[key] || null; | ||
} | ||
|
||
export function getAttributeValueTooltip(key: string): JSX.Element { | ||
return attributeValueTooltips[key] || null; | ||
} |
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.