kermit-algos 0.0.11

Algorithms used in Kermit
Documentation

kermit-algos

Join algorithms for the Kermit workspace. Currently implements the Leapfrog Triejoin — a worst-case-optimal multi-way join — generic over any data structure that implements TrieIterable.

Entry points

  • LeapfrogTriejoin — the algorithm's JoinAlgo implementation. Takes a parsed JoinQuery plus a map from predicate name to data structure reference, and returns an iterator over the join output.
  • LeapfrogTriejoinIter — the lower-level iterator produced by the algorithm. Exposes triejoin_open / triejoin_up for manual driving in tests.
  • LeapfrogJoinIter — the inner intersection that powers each depth of the triejoin.
  • JoinAlgorithm — CLI enum used by the binary to pick an algorithm at runtime.

Relationship to other crates

Depends on kermit-iters for iterator traits and kermit-parser for query ASTs. Accepts any relation implementing TrieIterable — in practice TreeTrie and ColumnTrie from kermit-ds.

See ARCHITECTURE.md for the overall query-evaluation flow and ARCHITECTURE.md#leapfrog-triejoin for a walkthrough of the algorithm as implemented here.

Extending

To add a new algorithm:

  1. Implement JoinAlgo<DS> on a marker type.
  2. Add a variant to JoinAlgorithm and wire it up in kermit/src/main.rs.