Skip to content

Conversation

mlin
Copy link
Owner

@mlin mlin commented May 22, 2021

No description provided.

@mlin mlin marked this pull request as ready for review May 22, 2021 23:12
@mlin
Copy link
Owner Author

mlin commented May 24, 2021

The current computation for btree_interior is a heuristic that admits false-positives. (Overflow, ptrmap, and freelist pages may have 2 or 5 in the first byte.) This leads to unnecessary data duplication, perhaps worsening as the database grows (as a proportion of the database size)

Additional heuristics can ameliorate this, perhaps sufficiently:

  • right-most pointer must be less than database page count
  • number of fragmented free bytes must be below 60
  • offset of first freeblock must follow start of the cell content area
  • number of cells cannot exceed page size / 5 - 1
  • cell pointers must all be >= start of the cell content area, and all pairs must have a difference of at least 5
  • cell left pointers must be less than database page count

@mlin mlin merged commit 37529b7 into main May 25, 2021
@mlin mlin deleted the mlin/btree-interior-index branch May 25, 2021 10:54
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