mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-05-27 16:25:12 +02:00
fix: stop pushing SPARQL LIMIT into child algebra nodes (#946)
The Slice evaluator was propagating the SPARQL LIMIT value as the inner limit for child evaluations, starving LeftJoin (OPTIONAL) and other operators of results. The safety limit parameter should flow through unchanged; LIMIT/OFFSET are applied only at the Slice node.
This commit is contained in:
parent
2c3a699af3
commit
81e9a3ebe4
1 changed files with 1 additions and 7 deletions
|
|
@ -262,13 +262,7 @@ async def _eval_order_by(node, tc, collection, limit):
|
|||
|
||||
async def _eval_slice(node, tc, collection, limit):
|
||||
"""Evaluate a Slice node (LIMIT/OFFSET)."""
|
||||
# Pass tighter limit downstream if possible
|
||||
inner_limit = limit
|
||||
if node.length is not None:
|
||||
offset = node.start or 0
|
||||
inner_limit = min(limit, offset + node.length)
|
||||
|
||||
solutions = await evaluate(node.p, tc, collection, inner_limit)
|
||||
solutions = await evaluate(node.p, tc, collection, limit)
|
||||
return slice_solutions(solutions, node.start or 0, node.length)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue