Skip to content

Commit

Permalink
cluster-ui/ui: remove ability to search statements by plan
Browse files Browse the repository at this point in the history
Closes  cockroachdb#83155

Previously, we allowed statements in the statements page to
searchable by text in the explain plan. This was before we
returned multiple plans for a statement fingerprint. This commit
removes the explain plan text as part of the searchable string, as
this feature could  now lead to confusing behaviour.

Release note (ui change): In the statements page, users can no
longer filter statements by searching for text in the EXPLAIN
plan.
  • Loading branch information
xinhaoz committed Jun 30, 2022
1 parent 08f8c03 commit 04684cd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,13 @@ describe("StatementsPage", () => {
};

assert.equal(filterBySearchQuery(statement, "select"), true);
assert.equal(filterBySearchQuery(statement, "virtual table"), true);
assert.equal(filterBySearchQuery(statement, "group (scalar)"), true);
assert.equal(filterBySearchQuery(statement, "count"), true);
assert.equal(filterBySearchQuery(statement, "select count"), true);
assert.equal(filterBySearchQuery(statement, "cluster settings"), true);

// Searching by plan should be false.
assert.equal(filterBySearchQuery(statement, "virtual table"), false);
assert.equal(filterBySearchQuery(statement, "group (scalar)"), false);
assert.equal(filterBySearchQuery(statement, "node_build_info"), false);
assert.equal(filterBySearchQuery(statement, "crdb_internal"), false);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ import {
} from "../timeScaleDropdown";

import { commonStyles } from "../common";
import { flattenTreeAttributes, planNodeToString } from "../statementDetails";
import moment from "moment";
const cx = classNames.bind(styles);
const sortableTableCx = classNames.bind(sortableTableStyles);
Expand Down Expand Up @@ -163,14 +162,7 @@ export function filterBySearchQuery(
statement: AggregateStatistics,
search: string,
): boolean {
const label = statement.label;
const plan = planNodeToString(
flattenTreeAttributes(
statement.stats.sensitive_info &&
statement.stats.sensitive_info.most_recent_plan_description,
),
);
const matchString = `${label} ${plan}`.toLowerCase();
const matchString = statement.label.toLowerCase();
return search
.toLowerCase()
.split(" ")
Expand Down

0 comments on commit 04684cd

Please sign in to comment.