Keyspace map
The first byte of every key names its owner. Keys of one owner sort together.
| Prefix | Owner | Layout |
|---|---|---|
0x00 |
catalog | 0x00 ‖ sub ‖ …, see Catalog records |
0x01 |
table rows (DATA) | 0x01 ‖ root_table_id u32 BE ‖ pk/interleave path, see Table rows |
0x02 |
non-unique B-tree index | 0x02 ‖ index_id u32 BE ‖ encoded index cols ‖ encoded pk |
0x03 |
unique B-tree index | 0x03 ‖ index_id u32 BE ‖ encoded index cols |
0x04 |
trigram postings | see Posting keys |
0x05 |
full-text postings | see Posting keys |
0x06 |
JSON-path index | 0x06 ‖ index_id u32 BE ‖ encoded scalar ‖ encoded pk |
0x07 |
materialized views | 0x07 ‖ view_id u32 BE ‖ …; 0x00 is the cursor key, see Materialized view keys |
0x10 |
RESP | see RESP keys |
| others | reserved | unused; new owners must take an unused first byte |
Index and row keys use order-preserving value encodings for the columns and the primary key. Entry layouts for the index prefixes are on Index entries.
The bloom filter treats some prefixes specially: the SQL layer registers skip tag 0x02 and, for tables created with WITH (bloom = off), the prefix 0x01 ‖ table_id (not for interleaved tables). See Ext B: bloom off.