Skip to content

fix(scan): avoid exact counts when retaining deleted rows - #9652

Open
geruh wants to merge 2 commits into
lance-format:mainfrom
geruh:codex/shared-deletion-scan-statistics
Open

geruh wants to merge 2 commits into
lance-format:mainfrom
geruh:codex/shared-deletion-scan-statistics

Conversation

@geruh

@geruh geruh commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Noticed that scans retaining its deleted rows could report the visible row count as exact even though the scan correctly emits the physical rows.

For example, a 60-row dataset with 5 deletions emits 60 rows in this mode but previously reported Exact(55).

This fixes the statistics in both scan plans by reporting the physical row count when it is trustworthy, and leaving the count unknown otherwise.

Validation:

  • cargo test --locked --profile ci -p lance --lib io::exec::scan::tests::, 13 passed.
  • Workspace clippy with -D warnings, formatting, diff checks, and pre-commit hooks passed. Clippy used the repository ci profile.

@github-actions github-actions Bot added the bug Something isn't working label Oct 1, 2026
Co-authored-by: Cursor <cursoragent@cursor.com>
@geruh
geruh force-pushed the codex/shared-deletion-scan-statistics branch from 1375ece to b5765a2 Compare October 3, 2026 01:32
@geruh
geruh marked this pull request as ready for review October 3, 2026 01:32

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

lance-gatekeeper[bot]

This comment was marked as outdated.

@lance-gatekeeper lance-gatekeeper Bot added the K-approved Latest Gatekeeper recommendation permits acceptance. label Oct 3, 2026
@lance-gatekeeper lance-gatekeeper Bot removed the K-approved Latest Gatekeeper recommendation permits acceptance. label Oct 3, 2026

@lance-gatekeeper lance-gatekeeper 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.

✅ Gate recommendation: approve.

Trusted physical counts fix the retained-deletion mismatch in both scan plans. Falling back to unknown for ranges and missing or historically unreliable metadata preserves safe query planning.

@lance-gatekeeper lance-gatekeeper Bot added the K-approved Latest Gatekeeper recommendation permits acceptance. label Oct 3, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working K-approved Latest Gatekeeper recommendation permits acceptance.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant