Skip to content

Commit

Permalink
Update key padding discussion
Browse files Browse the repository at this point in the history
  • Loading branch information
boiseamit committed Nov 5, 2024
1 parent 9198075 commit 017f69b
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -443,11 +443,10 @@ characters long (which would require 64 bytes). No value should go over 32 char
it does, then we simply truncate the sequence to just the first 32 characters. This would form
the key value.

Note that we always want to write a fixed size array on disk so that size of each TreeObject
is known ahead of time. In order to do that, we can pad each key to be 32 characters (by adding
spaces or null character at the end). We can also keep the key values to be their natural size
but pad them with null characters only when we store to the disk (and then remove the padding
when we read the key values back from the disk).
Note that we always want to write a fixed size array on disk so that size of each TreeObject is
known ahead of time. In order to do that, we can keep the key values to be their natural size
but pad them with null characters when we store to the disk (and then remove the padding when
we read the key values back from the disk).

### 4.2. Key Values
Note that the key values will be the two variables of that BTree's type concatenated with a dash (`-`)
Expand Down

0 comments on commit 017f69b

Please sign in to comment.