Skip to content

Commit

Permalink
chore(binary-plan): truncate long operator info for execution plan (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
baurine committed Sep 11, 2023
1 parent c7ccb33 commit 32ee1bb
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ export interface SlowqueryModel {
*/
'parse_time'?: number;
/**
*
* deprecated, replaced by BinaryPlanText
* @type {string}
* @memberof SlowqueryModel
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ export interface StatementModel {
*/
'min_latency'?: number;
/**
*
* deprecated, replaced by BinaryPlanText
* @type {string}
* @memberof StatementModel
*/
Expand Down
2 changes: 2 additions & 0 deletions ui/packages/tidb-dashboard-client/swagger/spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -4993,6 +4993,7 @@
"type": "number"
},
"plan": {
"description": "deprecated, replaced by BinaryPlanText",
"type": "string"
},
"plan_from_binding": {
Expand Down Expand Up @@ -5425,6 +5426,7 @@
"type": "integer"
},
"plan": {
"description": "deprecated, replaced by BinaryPlanText",
"type": "string"
},
"plan_can_be_bound": {
Expand Down
4 changes: 2 additions & 2 deletions ui/packages/tidb-dashboard-lib/src/client/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2345,7 +2345,7 @@ export interface SlowqueryModel {
*/
'parse_time'?: number;
/**
*
* deprecated, replaced by BinaryPlanText
* @type {string}
* @memberof SlowqueryModel
*/
Expand Down Expand Up @@ -3145,7 +3145,7 @@ export interface StatementModel {
*/
'min_latency'?: number;
/**
*
* deprecated, replaced by BinaryPlanText
* @type {string}
* @memberof StatementModel
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,14 @@ export const BinaryPlanTable: React.FC<BinaryPlanTableProps> = ({ data }) => {
minWidth: 100,
maxWidth: 300,
onRender: (row: BinaryPlanItem) => {
return <Tooltip title={row.operatorInfo}>{row.operatorInfo}</Tooltip>
// truncate the string if it's too long
// operation info may be super super long
const truncateLength = 1000
let truncatedStr = row.operatorInfo
if (truncatedStr.length > truncateLength) {
truncatedStr = row.operatorInfo.slice(0, truncateLength) + '...'
}
return <Tooltip title={row.operatorInfo}>{truncatedStr}</Tooltip>
}
},
{
Expand Down

0 comments on commit 32ee1bb

Please sign in to comment.