Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drastically improve large node (re)writes #245

Merged
merged 3 commits into from
Oct 2, 2023

Conversation

appy-one
Copy link
Owner

@appy-one appy-one commented Oct 2, 2023

Dramatically increase the performance of (re)wiring large nodes spanning multiple allocation ranges (logical pages) by:

  • Growing the max number of node entries faster (+50% instead of +10% per rebuild)
  • Optimizing the code that requests individual record entries for allocated ranges

Was 10%, but this causes growing trees to quickly increase the number of leafs and node levels instead of adding more entries to the leafs.
Example: A small tree with 5 entries per node/leaf is rebuilt when growing. Growing node entries with 10% means it now gets 5 + 0.5 = 5.5 = (rounded up) 6 entries. The next time, it gets 7 (6.6), then 8, 9, 10 etc.
Growing the number of entries in the leafs and nodes faster  improves the performance of the tree, using 50% the tree will grow as follows: 5 + 2.5 = 7.5 = 8 entries, then 8 + 4 = 12, then 12 + 6 = 18 etc.
This moves away from adding all allocated storage addresses for each range which is VERY slow on large nodes spanning multiple pages.  It now only requests target records for specific record numbers, and calculated counts only
Caching worked, but might cause unpredictable issues somewhere else
@appy-one appy-one self-assigned this Oct 2, 2023
@appy-one appy-one added the performance Issues and/or improvements regarding performance label Oct 2, 2023
@appy-one appy-one merged commit f92ad47 into master Oct 2, 2023
1 check passed
@appy-one appy-one deleted the improvement/bplustree-performance branch October 2, 2023 09:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Issues and/or improvements regarding performance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant