barrel_design_pushdown (barrel_design v0.1.0)

View Source

Key bounds from BQL WHERE conditions on v.key.

Only conditions that can narrow the scan are used, and BQL applies every condition again to the rows, so the bounds may be wider than the result but never narrower:

  • equalities on v.key[0], v.key[1], ... from component 0 form a key prefix;
  • one range (<, <=, >, >=, or LIKEstem%'') on the next component bounds the scan inside that prefix;
  • on a scalar key, v.key = X, ranges and LIKE on v.key.

For grouped rows only components below the group level count: WHERE filters the groups the view returns. v.key = X on an array key means membership in BQL, so it is never used.

Summary

Functions

bounds(KeySpec, Where, Mode)

-spec bounds({array, list()} | {scalar, map()}, [term()], map | {reduce, exact | non_neg_integer()}) ->
                none | {binary(), binary()}.