⚡ Bolt: Optimize exportDataDictionary with O(1) edge lookup - #561
Conversation
💡 What: Refactored `isForeignKeyColumn` in `exportDataDictionary.ts` to use a pre-computed Set (`fkHandles`) instead of an inline `Array.prototype.some` lookup. 🎯 Why: The previous implementation performed a linear array search over all edges for every column in every table during the nested `Nodes * Columns` loop, causing an O(N * C * E) performance bottleneck on large graphs. 📊 Impact: Reduces time complexity from O(N * C * E) to O(N * C + E), resulting in significantly faster markdown and CSV dictionary generation. 🔬 Measurement: Verify by executing `pnpm test` (passes) or generating a data dictionary in the application for a schema with 50+ interconnected tables.
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
There was a problem hiding this comment.
Pull request overview
OpenCode model providers were unavailable for this same-head run, but deterministic current-head evidence is clean: coverage evidence passed, peer GitHub Checks are complete, medium-or-higher code-scanning alerts are clear, mergeability is clean, and reviewer threads are resolved or outdated.
Findings
No blocking findings.
Evidence
- Result: APPROVE
- Reason: current-head model-unavailable evidence fallback; coverage, docstring, peer GitHub Checks, code-scanning alerts, mergeability, and review threads were clear for current head.
- Scope:
unsupported - Changed files:
0 - Model-pool outcome:
exhausted - Head SHA:
2b69fcee26d297f11962627cd60bdc673bf3bb6e - Workflow run: 29218428771
- Workflow attempt: 1
This fallback does not suppress failed checks, medium-or-higher code-scanning alerts, merge conflicts, unresolved reviewer threads, or failed coverage evidence; any of those conditions still publish REQUEST_CHANGES or leave the approval state unchanged.
There was a problem hiding this comment.
Pull request overview
OpenCode model providers were unavailable for this same-head run, but deterministic current-head evidence is clean: coverage evidence passed, peer GitHub Checks are complete, medium-or-higher code-scanning alerts are clear, mergeability is clean, and reviewer threads are resolved or outdated.
Findings
No blocking findings.
Evidence
- Result: APPROVE
- Reason: current-head model-unavailable evidence fallback; coverage, docstring, peer GitHub Checks, code-scanning alerts, mergeability, and review threads were clear for current head.
- Scope:
unsupported - Changed files:
0 - Model-pool outcome:
exhausted - Head SHA:
47b1997ac30dee8efd182a045fff095c44790524 - Workflow run: 29219880942
- Workflow attempt: 1
This fallback does not suppress failed checks, medium-or-higher code-scanning alerts, merge conflicts, unresolved reviewer threads, or failed coverage evidence; any of those conditions still publish REQUEST_CHANGES or leave the approval state unchanged.
There was a problem hiding this comment.
Pull request overview
OpenCode model providers were unavailable for this same-head run, but deterministic current-head evidence is clean: coverage evidence passed, peer GitHub Checks are complete, medium-or-higher code-scanning alerts are clear, mergeability is clean, and reviewer threads are resolved or outdated.
Findings
No blocking findings.
Evidence
- Result: APPROVE
- Reason: current-head model-unavailable evidence fallback; coverage, docstring, peer GitHub Checks, code-scanning alerts, mergeability, and review threads were clear for current head.
- Scope:
unsupported - Changed files:
0 - Model-pool outcome:
exhausted - Head SHA:
06aba4a5398f4dad79c4611ad485787088b4d755 - Workflow run: 29220413368
- Workflow attempt: 1
This fallback does not suppress failed checks, medium-or-higher code-scanning alerts, merge conflicts, unresolved reviewer threads, or failed coverage evidence; any of those conditions still publish REQUEST_CHANGES or leave the approval state unchanged.
💡 What: Refactored
isForeignKeyColumninexportDataDictionary.tsto use a pre-computedSetfor foreign key handles (fkHandles) instead of relying onArray.prototype.some()arrays scans inside nested loops.🎯 Why: The previous export algorithm executed a linear array search over all edges
Efor every columnCin every table nodeN. This resulted in a time complexity ofO(N * C * E). For large database schemas, this resulted in significant CPU blocking during data dictionary exports.📊 Impact: Reduces time complexity to
O(N * C + E)by evaluating the edges once upfront to construct anO(1)Set. This substantially eliminates UI locking/stuttering during large CSV and Markdown dictionary generation.🔧 Fix:
fkHandles: Set<string>toisForeignKeyColumnsignature.edges.some()withfkHandles.has(...).fkHandlesupfront inside bothexportDictionaryCsvandexportDictionaryMarkdown.✅ Verification: Ran
pnpm test --coverageconfirming 100% test coverage and no logic regressions. Recorded a learning entry in.Jules/bolt.md.PR created automatically by Jules for task 13144654603514284199 started by @seonghobae