Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

`sql_check keys` is O(|L| x |R|) per probe and reports "unmatched keys found" for any key subset

未关闭
#1,491 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 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) computes count(...) and exists(...) as correlated EXISTS over l x r with functions applied to both sides (LOWER(TRIM()), regexp_replace, a leading-zero CASE). The prefix_suffix probe is a non-equi SUBSTR comparison. None can use a hash join, so each probe is |L| x |R|.
  • The verdict (sql-check.ts:382) says "unmatched keys found" unless matched_exact equals both distinct counts, so a lookup of keys into a larger dimension table always "fails". Integer IDs also trigger a spurious prefix/suffix difference, because 12 is a prefix of 123.

Evidence

  • 119 recorded keys checks; 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

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

AltimateAI/altimate-code 的其他 Issue

查看 AltimateAI/altimate-code 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。