You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
SQL pushdown lane: bound the block-size probe instead of a full COUNT(*) #1784
Once an outer side passes one key set (2000 rows), SqlBlockSource::count_block sends SELECT COUNT(*) over the branch to decide whether to fetch it whole and hash-join in memory (see fluree-db-query/src/r2rml/sql_lane/mod.rs). The count is unbounded: on the 1M-row Postgres shop.orders it costs about 15 ms per query even though the answer (1,000,000) exceeds the cache cap the moment it passes 100,000, and the block stays seeded anyway.
Measured with sql_pushdown_lane_probe (outer-orders-5k): 25 ms seeded without the probe, 43 ms with it.
A bounded probe would cap that cost at the cap itself: SELECT COUNT(*) FROM (<branch statement> LIMIT cap + 1) AS p. That needs a derived-table node in the plan IR (RelNode) and renderer support on each dialect, plus the fake endpoint's parser, which is why it was not done with the cache itself.
Activity
perf(sql): bound the block-size probe at the cache cap