`sql_check keys` is O(|L| x |R|) per probe and reports "unmatched keys found" for any key subset
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 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
- 星标
- 812
- 派生
- 123
- 平均合并
- 1 天 16 小时
- 30 天内合并 PR
- 85
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
AltimateAI/altimate-code 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 76/100
AltimateAI/altimate-code#1573 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
AltimateAI/altimate-code#1572 ·
维护者通常 1 天内回复
-
难度 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 天内回复
查看 AltimateAI/altimate-code 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 66/100
db-ux-design-system/core-web#8613 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
bug:new
难度 1/5 1 小时以内 新手友好度 78/100
callstackincubator/simlock#934 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 68/100
gchq/LD-Explorer#286 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复