Re: comment on CR 10.1 "solution sequences and result forms"

Fred Zemke wrote:
> 
> 
> 
> 10.1 Solution sequences and result forms
> The proposed order for processing LIMIT and OFFSET seems
> counterintuitive.  Suppose the solution sequence has solutions
> (S1, S2, ..., S9).  Suppose the user asks for LIMIT 3 and OFFSET 4.
> With the current rules, LIMIT 3 will truncate the solution
> sequence to (S1, S2, S3) and then the offset is greater than the
> number of solutions so the final result is empty.  Instead,
> in this scenario, I think the user expects to get (S5, S6, S7).
> Thus the offset should be applied first, reducing the solution
> sequence to (S5, S6, ..., S9), and then the LIMIT should be
> applied.  From this standpoint, the BNF for SolutionModifier
> should be rearranged to put OffsetClause ahead of LimitClause.
> 
> Fred

I agree the correct processing order is OFFSET then LIMIT.  The document text 
order follows the syntax.  What's the correct SQL syntax here?  Do SQL queries 
have to be in the order

SELECT  ...
LIMIT ...
OFFSET ...

I checked Oracle, PostgreSQL and MySQL - their documentation says this is the 
only allowed order in the syntax.

This is what the SPARQL spec currently follows and the text in section 10 
reflects that order.

[We could allow both orderings in the grammar and reorganise the text in 
section 10 to put OFFSET processing more clearly before LIMIT.]

	Andy

Received on Wednesday, 7 June 2006 15:57:02 UTC