barrel_bql_query (barrel v1.0.1)
View SourceBQL execution in barrel: collection sources delegate to the docdb executor; table-function sources (vector_top_k, bm25_top_k, hybrid_top_k) run here, where the vector store and the embedder live.
Table-function pipeline: search top KFetch hits (single over-fetch when a WHERE must filter them, no re-query loop: the contract is UP TO k rows) -> batch-join hits to their documents (hits without a document are dropped) -> residual WHERE via barrel_query:match/2 -> truncate to k -> unnest/order/offset/limit/project through the shared barrel_bql_exec post stages.
Summary
Functions
Start a live query for a compiled SUBSCRIBE plan. Deltas go to the owner; see barrel_bql_live for the message shapes.
Functions
-spec explain(barrel:db(), barrel_bql_lower:plan()) -> {ok, map()} | {error, term()}.
-spec subscribe_plan(barrel:db(), barrel_bql_lower:plan(), map()) -> {ok, #{ref := reference(), pid := pid()}} | {error, term()}.
Start a live query for a compiled SUBSCRIBE plan. Deltas go to the owner; see barrel_bql_live for the message shapes.