Skip to content

Commit 94507ea

Browse files
yihuangmmsqe
andauthored
Problem: memiavl README is not up-to-date (#915)
* Problem: memiavl README is not up-to-date Solution: - fix it * Update memiavl/README.md Co-authored-by: mmsqe <tqd0800210105@gmail.com> Signed-off-by: yihuang <huang@crypto.com> --------- Signed-off-by: yihuang <huang@crypto.com> Co-authored-by: mmsqe <tqd0800210105@gmail.com>
1 parent 47814cd commit 94507ea

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

memiavl/README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
* Update metadata file format
1212
* Encode key length with 4 bytes instead of 2.
1313
* 24 Feb 2023:
14-
* Reduce node size without hash) from 32bytes to 16bytes, leverage properties of post-order traversal.
15-
* Merge key-values into single kvs file, build MPHF hash table to index it.
14+
* Reduce node size without hash from 32bytes to 16bytes, leverage properties of post-order traversal.
15+
* Merge key-values into single kvs file, build optional MPHF hash table to index it.
1616

1717

1818
## The Journey
@@ -89,10 +89,11 @@ IAVL snapshot is composed by four files:
8989
_padding : 3
9090
version : 4
9191
key offset : 8
92+
hash : [32]byte
9293
```
93-
The node has fixed length, can be indexed directly. The nodes reference each other with the node index, nodes are written in post-order, so the root node is always placed at the end.
94+
The node has fixed length, can be indexed directly. The nodes references each other with the node index, nodes are written with post-order depth-first traversal, so the root node is always placed at the end.
9495

95-
For branch node, the `key node` field reference the smallest leaf node in the right branch, the key slice is fetched from there indirectly, the leaf nodes will store key slice and value index informations, but the version field is stored in `keys` file instead.
96+
For branch node, the `key node` field reference the smallest leaf node in the right branch, the key slice is fetched from there indirectly, the leaf nodes stores the `offset` into the `kvs` file, where the key and value slices can be built.
9697

9798
The branch node's left/child node indexes are inferenced from existing information and properties of post-order traversal:
9899

@@ -115,7 +116,7 @@ IAVL snapshot is composed by four files:
115116
*repeat*
116117
```
117118

118-
- `kvs.index`, Minimal-perfect-hash-function build from `kvs`, support query as a hash map.
119+
- `kvs.index`, optional MPHF(Minimal-Perfect-Hash-Function) hash index build from `kvs`, support query key-values as a hash map.
119120

120121
#### Compression
121122

0 commit comments

Comments
 (0)