Skip to content

Say what the unilateral value saves over a set of deleted rows - #78

Merged
drametwally merged 1 commit into
mainfrom
document-what-uni-deletion-saves
Sep 21, 2026
Merged

drametwally merged 1 commit into
mainfrom
document-what-uni-deletion-saves

Conversation

@drametwally

Copy link
Copy Markdown
Collaborator

The deletion section explained why a tombstone lives in the unilateral value rather than in a
set of deleted row numbers, but not what that is worth. It is worth different amounts in
different structures, and one of them gains nothing from the usual argument.

  • The matrix index gains the most. It derives a similarity for every row from that value, so
    excluding a deleted row incurs no cost beyond arithmetic the search already performs. A set
    would add a lookup for every row of every query.
  • A scan index and the caches gain nearly as much. The tombstone is a field of the record they
    have already fetched, so there is no second structure to consult.
  • An inverted index gains least. Its lists are ordered by unilateral value, so the tombstone
    cannot sit on the key the search prunes against. A deleted row is generated as a candidate
    and dropped only when verification reads its record. What it still gains is the absence of a
    second structure to maintain.

It also records a property that was load-bearing but unstated: a scorer that selects where it
scores and returns only the rows it kept has to apply deletion at that site, and the unilateral
values are already copied there for the arithmetic. A set would have to be copied too and kept
in step with every delete, or the selection would return deleted rows and leave the caller
short of what it asked for.

Prose only. No code changes.

The section gave the reason for the representation but not what it is worth, which differs by
structure: free in the matrix index, a field read in a scan, and later than pruning in an
inverted index, whose lists are ordered by the same value.

Records the property a scorer selecting where it scores depends on, which is that the tombstone
is already wherever the arithmetic is.
@drametwally
drametwally merged commit 14f534c into main Sep 21, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant