-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathdb_index.h
More file actions
29 lines (24 loc) · 750 Bytes
/
db_index.h
File metadata and controls
29 lines (24 loc) · 750 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#pragma once
// Index data structure after DbArena object
// Btree1Index global data on disk after Arena
// Global Index data structure after DbArena object
typedef struct {
uint64_t numKeys[1]; // number of keys in index
DbAddr keySpec;
bool delimFlds; // keys made with field values
bool uniqueKeys; // keys made with field values
} DbIndex;
typedef struct {
union {
uint8_t *keyBuff;
DbAddr bytes;
};
ObjId docId[1];
uint16_t lastFld;
uint16_t keyMax;
uint16_t keyLen; // len of entire key
uint16_t delimFlds; // use key fields with binary comparisons
uint16_t suffixLen; // len of payload key at end
uint8_t unique : 1; // index is unique
uint8_t deferred : 1; // uniqueness deferred
} DbKeyValue;