Skip to content

Commit fd73c06

Browse files
authored
Merge pull request #4019 from github/nickrolfe/join-order-cleanup
Fix reporting of bad join orders in recursive predicates
2 parents 41be887 + 84441f0 commit fd73c06

File tree

10 files changed

+217
-293
lines changed

10 files changed

+217
-293
lines changed

extensions/ql-vscode/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## [UNRELEASED]
44

5+
- Fix reporting of bad join orders in recursive predicates. [#4019](https://github.com/github/vscode-codeql/pull/4019)
6+
57
## 1.17.2 - 27 March 2025
68

79
- Always authenticate when downloading databases from GitHub, instead of only when in canary mode. [#3941](https://github.com/github/vscode-codeql/pull/3941)

extensions/ql-vscode/src/compare-performance/compare-performance-view.ts

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@ import { withProgress } from "../common/vscode/progress";
1616
import { telemetryListener } from "../common/vscode/telemetry";
1717
import type { HistoryItemLabelProvider } from "../query-history/history-item-label-provider";
1818
import { PerformanceOverviewScanner } from "../log-insights/performance-comparison";
19-
import { scanLog } from "../log-insights/log-scanner";
2019
import type { ResultsView } from "../local-queries";
20+
import { readJsonlFile } from "../common/jsonl-reader";
21+
import type { SummaryEvent } from "../log-insights/log-summary";
2122

2223
export class ComparePerformanceView extends AbstractWebview<
2324
ToComparePerformanceViewMessage,
@@ -46,8 +47,20 @@ export class ComparePerformanceView extends AbstractWebview<
4647
function scanLogWithProgress(log: string, logDescription: string) {
4748
const bytes = statSync(log).size;
4849
return withProgress(
49-
async (progress) =>
50-
scanLog(log, new PerformanceOverviewScanner(), progress),
50+
async (progress) => {
51+
progress?.({
52+
// all scans have step 1 - the backing progress tracker allows increments instead of
53+
// steps - but for now we are happy with a tiny UI that says what is happening
54+
message: `Scanning ...`,
55+
step: 1,
56+
maxStep: 2,
57+
});
58+
const scanner = new PerformanceOverviewScanner();
59+
await readJsonlFile<SummaryEvent>(log, async (obj) => {
60+
scanner.onEvent(obj);
61+
});
62+
return scanner;
63+
},
5164

5265
{
5366
title: `Scanning evaluator log ${logDescription} (${(bytes / 1024 / 1024).toFixed(1)} MB)`,

extensions/ql-vscode/src/extension.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ import {
2828
CliConfigListener,
2929
DistributionConfigListener,
3030
GitHubDatabaseConfigListener,
31-
joinOrderWarningThreshold,
3231
QueryHistoryConfigListener,
3332
QueryServerConfigListener,
3433
VariantAnalysisConfigListener,
@@ -102,7 +101,6 @@ import { getPackagingCommands } from "./packaging";
102101
import { HistoryItemLabelProvider } from "./query-history/history-item-label-provider";
103102
import { EvalLogViewer } from "./query-evaluation-logging";
104103
import { SummaryLanguageSupport } from "./log-insights/summary-language-support";
105-
import { JoinOrderScannerProvider } from "./log-insights/join-order";
106104
import { LogScannerService } from "./log-insights/log-scanner-service";
107105
import { VariantAnalysisView } from "./variant-analysis/variant-analysis-view";
108106
import { VariantAnalysisViewSerializer } from "./variant-analysis/variant-analysis-view-serializer";
@@ -941,11 +939,6 @@ async function activateWithInstalledDistribution(
941939
void extLogger.log("Initializing evaluation log scanners.");
942940
const logScannerService = new LogScannerService(qhm);
943941
ctx.subscriptions.push(logScannerService);
944-
ctx.subscriptions.push(
945-
logScannerService.scanners.registerLogScannerProvider(
946-
new JoinOrderScannerProvider(() => joinOrderWarningThreshold()),
947-
),
948-
);
949942

950943
void extLogger.log("Initializing compare view.");
951944
const compareView = new CompareView(

0 commit comments

Comments
 (0)