Skip to content

0.4.122

Choose a tag to compare

@TimoKramer TimoKramer released this 05 Apr 21:50
Add hasSubtreeCounts() for O(1) check before count-slice

Old databases restored from storage may have Branch nodes with
subtreeCount = -1 (unknown). In that case, countSlice degrades
from O(log n) to O(n) as it materializes entire subtrees.

This method lets callers (e.g. Datahike's query planner) check
upfront and fall back to heuristic estimates instead of paying
the O(n) cost during planning.