Skip to content

Commit

Permalink
Update design doc with value alignment design
Browse files Browse the repository at this point in the history
This feature is not implemented, and there is no clear path to
implementing it (see #360).
However, if it becomes possible to implement it in the future, this
design should be backward compatible
  • Loading branch information
cberner committed Feb 11, 2023
1 parent f5eba2d commit e50cc24
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions docs/design.md
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ Allocated pages may be of two types: b-tree branch pages, or b-tree leaf pages.
--------------------------------------------------------------------------------------------------
| child page number (repeated num_keys + 1 times) |
--------------------------------------------------------------------------------------------------
| (optional) key end (repeated num_keys times) | ... more key ends |
| (optional) key end (repeated num_keys times) | alignment padding |
==================================================================================================
| Key data |
==================================================================================================
Expand All @@ -253,6 +253,8 @@ Allocated pages may be of two types: b-tree branch pages, or b-tree leaf pages.

`key_end` is an array of ending offsets for the keys. It is optional, MUST NOT be stored for fixed width key types

`alignment padding` optional padding so that the key data begins at a multiple of the key type's required alignment

### Leaf page:
* 1 byte: type
* 1 byte: reserved (padding to 16bits aligned)
Expand All @@ -270,9 +272,9 @@ Allocated pages may be of two types: b-tree branch pages, or b-tree leaf pages.
==================================================================================================
| type | padding | number of entries | (optional) key end (repeated entries times) |
--------------------------------------------------------------------------------------------------
| (optional) value end (repeated entries times) | .. more key/value ends |
| (optional) value end (repeated entries times) | (optional) key alignment padding |
==================================================================================================
| Key data |
| Key data | (optional) value alignment padding |
==================================================================================================
| Value data |
==================================================================================================
Expand All @@ -286,6 +288,10 @@ Allocated pages may be of two types: b-tree branch pages, or b-tree leaf pages.

`value_end` is an array of ending offsets for the values. It is optional, MUST NOT be stored for fixed width value types

`key alignment padding` optional padding so that the key data begins at a multiple of the key type's required alignment

`value alignment padding` optional padding so that the value data begins at a multiple of the value type's required alignment

# Commit strategies

All redb transactions are atomic, and use one of the following commit strategies.
Expand Down

0 comments on commit e50cc24

Please sign in to comment.