`sql_check keys` is O(|L| x |R|) per probe and reports "unmatched keys found" for any key subset
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 35/100
- Tipo de issue
- Bug
- Clareza
- Claramente especificada
- Status de atividade
- Ativa
- Stack de tecnologia
- sql, typescript
- Domínio
- data-engineering, databases
Direção de pesquisa
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.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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.
- Linguagem predominante
- TypeScript
- Estrelas
- 812
- Forks
- 123
- Merge médio
- 1d 16h
- PRs com merge (30d)
- 85
Preparar o ambiente
Inicia o contêiner de desenvolvimento do projeto no navegador, com a sua própria conta do GitHub.
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de AltimateAI/altimate-code
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
AltimateAI/altimate-code#1573 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
AltimateAI/altimate-code#1572 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
AltimateAI/altimate-code#1454 ·
Mantenedores costumam responder em até 1 dia
-
test: MCP tests fail when the developer's ~/.claude.json has MCP servers (HOME is not sandboxed)Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
AltimateAI/altimate-code#1386 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 84/100
AltimateAI/altimate-code#1384 ·
Mantenedores costumam responder em até 1 dia
Todas as issues de AltimateAI/altimate-code
Issues semelhantes
-
area:agent-view area:tui bug platform:macos
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
anthropics/claude-code#104558 ·
Mantenedores costumam responder em até 1 dia
-
updater
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
UniversityOfHelsinkiCS/oodikone#5141 ·
-
maintanance
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 74/100
inmanta/web-console#7606 ·
Mantenedores costumam responder em até 1 dia
-
bug skills
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 77/100
equinor/fusion-framework#5846 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 74/100