Skip to content

⚡ Bolt: Optimize exportDataDictionary with O(1) edge lookup - #561

Merged
seonghobae merged 3 commits into
mainfrom
bolt-optimize-exportDataDictionary-13144654603514284199
Jul 13, 2026
Merged

⚡ Bolt: Optimize exportDataDictionary with O(1) edge lookup#561
seonghobae merged 3 commits into
mainfrom
bolt-optimize-exportDataDictionary-13144654603514284199

Conversation

@seonghobae

Copy link
Copy Markdown
Collaborator

💡 What: Refactored isForeignKeyColumn in exportDataDictionary.ts to use a pre-computed Set for foreign key handles (fkHandles) instead of relying on Array.prototype.some() arrays scans inside nested loops.

🎯 Why: The previous export algorithm executed a linear array search over all edges E for every column C in every table node N. This resulted in a time complexity of O(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 an O(1) Set. This substantially eliminates UI locking/stuttering during large CSV and Markdown dictionary generation.

🔧 Fix:

  • Added fkHandles: Set<string> to isForeignKeyColumn signature.
  • Replaced edges.some() with fkHandles.has(...).
  • Instantiated fkHandles upfront inside both exportDictionaryCsv and exportDictionaryMarkdown.

Verification: Ran pnpm test --coverage confirming 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

💡 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.
@google-labs-jules

Copy link
Copy Markdown

👋 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@seonghobae
seonghobae enabled auto-merge (squash) July 13, 2026 02:36

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@seonghobae
seonghobae merged commit be0a948 into main Jul 13, 2026
25 checks passed
@seonghobae
seonghobae deleted the bolt-optimize-exportDataDictionary-13144654603514284199 branch July 13, 2026 03:05
This was referenced Jul 31, 2026
This was referenced Jul 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant