Overview
limousine_engine provides procedural macros to automatically generate an (immutable) hybrid index design:
use *;
create_immutable_hybrid_index!
To generate a design, we provide a name for the structure, and a layout description, which resembles the syntax of a Rust match expression. In this example, the first two layers are BTree layers with a fanout of 16, and the rest of the layers are PGM layers with an epsilon parameter of 4. All of this is parsed and generated into a static implementation at compile time by the procedural macro. We can also generate efficient pure designs using this approach:
use *;
create_immutable_hybrid_index!
create_immutable_hybrid_index!
We can then use these generated structs to perform queries:
// Load the first two layer of the index from memory
let index = load?;
// Range query
for in index.range