terminusdb / terminusdb-store

a tokio-enabled data store for triple data

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

New recursive iteration strategy

matko opened this issue · comments

Our current iterators drill down the entire layer stack to find triples, returning them in a stable order. This order is stable even if you do delta rollups, which allows fast comparisons in some cases.

In the majority of cases though, the benefits of this approach are irrelevant, and we get to our first result much slower than we would otherwise. It'd be good if we have an iteration strategy which recursively descends through the layers, returning triples as they are found.

This is especially useful for cases where we're really only interested in a single result, such as when there can be only one result due to a cardinality constraint enforced externally.

Implement this new iteration strategy as a new set of iterators accessible through a new set of methods in layer.