Repository navigation
feat(csr): report how far the base csr trails the data - #93
Merged
Merged
Conversation
csr_stats() now reports base_version, the relationship dataset version of the last full build, and unindexed_edges, the live edges held outside the base (appended since that build and not since removed). delta_edges counts every append, including ones later deleted, so it can't answer that. Tombstones that remove appended edges are counted separately in Adjacency to make the live count exact.
Deploying lance-csr with
|
| Latest commit: |
e4cdf72
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://7eb5168a.lance-csr.pages.dev |
| Branch Preview URL: | https://feat-csr-freshness-stats.lance-csr.pages.dev |
prrao87
marked this pull request as ready for review
October 30, 2026 19:38
This was referenced Oct 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
csr_stats()says how a refresh updated the CSR, but not how far its base trails the data.delta_edgescounts every edge appended since the last full build, including ones deleted since, so it can't tell you how many live edges sit outside the base. This is the reporting half of #75, using the terms Lance's index statistics use. The explicit optimize step it also asks for is left for a later PR, so #75 stays open.What changed
csr_stats()reports two new fields per relationship type, in Rust (CsrStats) and Python:base_version: the relationship dataset version of the last full build (Nonefor PyArrow input). It trailsversionwhile refreshes apply deltas.unindexed_edges: live edges outside the base CSR, appended since its last full build and not since removed. Lance calls thisnum_unindexed_rows.To make
unindexed_edgesexact, the adjacency now counts tombstones that remove appended edges separately from those that remove base edges. Query results don't change: base plus delta already gives exact answers for the pinned snapshot. The new fields only say how much of the work the delta carries.The CSR guide's field table and the "How to keep the CSR fresh" steps describe both fields.
Validation
-D warningsandcargo fmt --check. Unit tests cover tombstones on base and appended edges, including an appended edge from a source key the base doesn't have.typospass.🤖 Generated with Claude Code