Skip to content

Commit cb44665

Browse files
committed
Include RA hashes in messages about bad join orders
1 parent dba5150 commit cb44665

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

extensions/ql-vscode/src/log-insights/join-order.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -205,9 +205,10 @@ class JoinOrderScanner {
205205
resultSize!,
206206
);
207207
if (metric >= this.warningThreshold) {
208-
const message = `'${
209-
event.predicateName
210-
}' has an inefficient join order. Its join order metric is ${metric.toFixed(
208+
const message = `'${event.predicateName}@${event.raHash.substring(
209+
0,
210+
8,
211+
)}' has an inefficient join order. Its join order metric is ${metric.toFixed(
211212
2,
212213
)}, which is larger than the threshold of ${this.warningThreshold.toFixed(
213214
2,
@@ -243,9 +244,10 @@ class JoinOrderScanner {
243244
resultSize,
244245
);
245246
if (metric >= this.warningThreshold) {
246-
const message = `The ${raReference} pipeline for '${
247-
predicateName
248-
}' has an inefficient join order. Its join order metric is ${metric.toFixed(
247+
const message = `The ${raReference} pipeline for '${predicateName}@${raHash.substring(
248+
0,
249+
8,
250+
)}' has an inefficient join order. Its join order metric is ${metric.toFixed(
249251
2,
250252
)}, which is larger than the threshold of ${this.warningThreshold.toFixed(
251253
2,

extensions/ql-vscode/test/unit-tests/log-scanner.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ describe("log scanners", () => {
6262
);
6363
expect(problemReporter.problems[0].order).toBe("order_500000");
6464
expect(problemReporter.problems[0].message).toBe(
65-
"The order_500000 pipeline for 'Enclosing::exprEnclosingElement#c50c5fbf#ff' has an inefficient join order. Its join order metric is 98.07, which is larger than the threshold of 50.00.",
65+
"The order_500000 pipeline for 'Enclosing::exprEnclosingElement#c50c5fbf#ff@7cc60wto' has an inefficient join order. Its join order metric is 98.07, which is larger than the threshold of 50.00.",
6666
);
6767

6868
expect(problemReporter.problems[1].predicateName).toBe("#select#ff");
@@ -71,7 +71,7 @@ describe("log scanners", () => {
7171
);
7272
expect(problemReporter.problems[1].order).toBeUndefined();
7373
expect(problemReporter.problems[1].message).toBe(
74-
"'#select#ff' has an inefficient join order. Its join order metric is 4961.83, which is larger than the threshold of 50.00.",
74+
"'#select#ff@1bb43c97' has an inefficient join order. Its join order metric is 4961.83, which is larger than the threshold of 50.00.",
7575
);
7676
});
7777
});

0 commit comments

Comments
 (0)