`sql_check keys` is O(|L| x |R|) per probe and reports "unmatched keys found" for any key subset
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- sql, typescript
調査の方向性
Start with checkKeys in packages/opencode/src/altimate/tools/sql-check.ts (around lines 314-347), where the correlated EXISTS probes are built, then read the verdict logic near line 382. The work spans query shape, the prefix/suffix probe and the reported wording, so it needs more context than a first contribution usually has. Done means 7k x 130k distinct keys finish in under 5 s, a left-subset result reports complete left coverage, and integer keys produce no prefix/suffix findings.
索引モデルが issue の本文から書いたものです。
説明
Problem
sql_check in keys mode can run for minutes on large tables and then reports "unmatched keys found" even when every left key matches a right key.
Mechanism
checkKeys(packages/opencode/src/altimate/tools/sql-check.ts:314-347) computescount(...)andexists(...)as correlatedEXISTSoverl x rwith functions applied to both sides (LOWER(TRIM()),regexp_replace, a leading-zeroCASE). Theprefix_suffixprobe is a non-equiSUBSTRcomparison. None can use a hash join, so each probe is |L| x |R|.- The verdict (
sql-check.ts:382) says "unmatched keys found" unlessmatched_exactequals both distinct counts, so a lookup of keys into a larger dimension table always "fails". Integer IDs also trigger a spurious prefix/suffix difference, because12is a prefix of123.
Evidence
- 119 recorded
keyschecks; 32 took over 30 s (3,170 s total, 10 sessions); one took 360 s with nothing else running. Size: 6,696 left keys x 127,600 right keys, about 854M pairs times seven probes. - 71 of 87 "unmatched keys found" verdicts had every left key matched exactly; 53 of those also flagged a spurious prefix/suffix difference.
Impact
Time (consumes budget in sessions using gpt-5.6-sol) and a misleading verdict.
Proposed fix
- Compute the normalised forms once per side in CTEs and match with equality joins.
- Run the prefix/suffix probe on a bounded sample, or only over unmatched keys.
- Report left coverage ("left subset of right: 6,696/6,696") separately from right coverage and word the verdict accordingly.
- Skip text-format probes when both columns are integer-typed.
Acceptance check
- 7k x 130k distinct keys finish in under 5 s.
- Left keys fully contained in a larger right set yield a verdict that says left coverage is complete.
- Integer keys do not produce prefix/suffix findings.
- 主要言語
- TypeScript
- スター
- 810
- フォーク
- 121
- 平均マージ
- 1日 12時間
- マージ済み PR(30日)
- 94
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
AltimateAI/altimate-code のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
AltimateAI/altimate-code#1454 ·
メンテナーはふだん 1 日以内に返信
-
test: MCP tests fail when the developer's ~/.claude.json has MCP servers (HOME is not sandboxed)オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
AltimateAI/altimate-code#1386 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
AltimateAI/altimate-code#1384 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
AltimateAI/altimate-code#1323 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
AltimateAI/altimate-code#1288 ·
メンテナーはふだん 1 日以内に返信
AltimateAI/altimate-code の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
simkimsia/netlify-axi#19 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
subhranshudash13-dotcom/Contribo#74 ·
メンテナーはふだん 1 日以内に返信
-
enhancement frontend good first issue Stellar Wave trivial
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
Godgift-care/sci-healthcare-frontend#166 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
backend good first issue security Stellar Wave trivial
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
Godgift-care/sci-healthcare-backend#171 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信