Update index.md

Signed-off-by: naivewong <867245430@qq.com>
This commit is contained in:
Alec 2019-02-05 10:28:05 +08:00 committed by naivewong
parent 2b6bc9fb32
commit 8e589474c6

View file

@ -176,24 +176,24 @@ The sequence of postings sections is finalized by an [offset table](#offset-tabl
An offset table stores a sequence of entries that maps a list of strings to an offset. They are used to track label index and postings sections. They are read into memory when an index file is loaded. An offset table stores a sequence of entries that maps a list of strings to an offset. They are used to track label index and postings sections. They are read into memory when an index file is loaded.
``` ```
┌─────────────────────┬────────────────────┐ ┌─────────────────────┬──────────────────────
│ len <4b>#entries <4b> │ len <4b>#entries <4b>
├─────────────────────┴────────────────────┤ ├─────────────────────┴──────────────────────
│ ┌──────────────────────────────────────┐ │ │ ┌────────────────────────────────────────┐ │
│ │ n = #strs <uvarint> │ │ │ │ n = #strs <uvarint> │ │
│ ├──────────────────────┬───────────────┤ │ │ ├──────────────────────┬─────────────────┤ │
│ │ len(str_1) <uvarint> │ str_1 <bytes> │ │ │ │ len(str_1) <uvarint> │ str_1 <bytes> │ │
│ ├──────────────────────┴───────────────┤ │ │ ├──────────────────────┴─────────────────┤ │
│ │ ... │ │ │ │ ... │ │
│ ├──────────────────────┬───────────────┤ │ │ ├──────────────────────┬─────────────────┤ │
│ │ len(str_n) <uvarint> │ str_n <bytes> │ │ │ │ len(str_n) <uvarint> │ str_n <bytes> │ │
│ ├──────────────────────┴───────────────┤ │ │ ├──────────────────────┴─────────────────┤ │
│ │ offset <uvarint> │ │ │ │ offset <uvarint64> │ │
│ └──────────────────────────────────────┘ │ │ └────────────────────────────────────────┘ │
│ . . . │ . . . │
├──────────────────────────────────────────┤ ├────────────────────────────────────────────
│ CRC32 <4b> │ CRC32 <4b>
└──────────────────────────────────────────┘ └────────────────────────────────────────────
``` ```