Skip to content

Latest commit

 

History

History
55 lines (54 loc) · 1.79 KB

fts-lmdb.org

File metadata and controls

55 lines (54 loc) · 1.79 KB

FTS with LMDB

Chunks

Can be very small – currently org elements or lines

Numbers – lexicographically ordered

7 bits0 - 1270xxxxxxx
12 bits128 - 40951000xxxx X
20 bits4096 - 10485751001xxxx X X
28 bits1048576 - 2684354551010xxxx X X X
36 bits268435456 - 687194767351011xxxx X X X X
44 bits68719476736 - 175921860444151100xxxx X X X X X
52 bits17592186044416 - 45035996273704951101xxxx X X X X X X
60 bits4503599627370496 - 11529215046068469751110xxxx X X X X X X X
64 bits1152921504606846976 - 184467440737095516151111---- X X X X X X X X

Trees

Grams: GRAM-> BLOCK

GRAM is a 2-byte value

OID LIST

Gram 0 holds the info since 0 is not a legal gram

next unused oid
start of free list
group name …

Chunk: OID -> BLOCK

OIDS are compressed integers

Chunk entries are <first tag Y, data> first tag Y is the start of the threaded tag list data is arbitrary data for the object

GID
data (e.g. line number)
totalGrams

Groups: GID -> BLOCK

Used for bookkeeping, to be able to remove chunks

NAME

Group Names: NAME->GID

OID LISTS

# 1-byte OIDS
# 2-byte OIDS
# 3-byte OIDS
# 4-byte OIDS
# 5-byte OIDS
# 6-byte OIDS
# 7-byte OIDS
# 8-byte OIDS
# 9-byte OIDS
OIDS