e1bae0c7a0
- Add docs/ folder with English (en/) and Bulgarian (bg/) documentation - Create index.md with language switching and links - English docs: installation, quickstart, architecture, baraql, storage, schema, lsm, btree, vector, graph, fts, columnar, transactions, distributed, protocol, udf, api-binary, api-http, api-websocket - Bulgarian docs: installation, quickstart, architecture, baraql, schema, lsm, btree, vector, graph, fts, transactions, distributed - Update README license to BSD 3-Clause - Add LICENSE file with BSD 3-Clause text
38 lines
640 B
Markdown
38 lines
640 B
Markdown
# B-Tree Index
|
|
|
|
Ordered index structure for efficient range scans and point lookups.
|
|
|
|
## Usage
|
|
|
|
```nim
|
|
import barabadb/storage/btree
|
|
|
|
var btree = newBTreeIndex[string, string]()
|
|
|
|
# Insert
|
|
btree.insert("key1", "value1")
|
|
btree.insert("key2", "value2")
|
|
|
|
# Point lookup
|
|
let values = btree.get("key1")
|
|
|
|
# Range scan
|
|
let range = btree.scan("key_a", "key_z")
|
|
|
|
# Delete
|
|
btree.delete("key1")
|
|
```
|
|
|
|
## Features
|
|
|
|
- Ordered key-value storage
|
|
- Range queries (BETWEEN, >, <, >=, <=)
|
|
- Prefix scans
|
|
- Configurable page size
|
|
- Iterator support
|
|
|
|
## Use Cases
|
|
|
|
- Primary key indexes
|
|
- Secondary indexes for frequently queried columns
|
|
- Range-partitioned data |