Re: New "order by" clause

At 05:42 AM 11/18/2002 -0500, Bas de Bakker wrote:

>Dear XQuery WG,
>
>In the new working draft you invite feedback on the new "order by"
>clause.  Reading the issue list, it seems to have been created because
>of incorrect assumptions.  In issue 155, I read:

[[[ !!! SNIP !!! ]]]

Hi Bas,

To me, Issue 155 is not the main reason for moving to 'order by'. As you 
point out, there are other ways of achieving the same functionality, and I 
think there is probably no significant difference in the expressive power 
using 'sort by ()' or the 'order by' clause.

A more compelling reason for 'order by' involves sorting of elements 
constructed by a FLWOR expression. In most environments, indexes are 
related to the input of a query, not to the output. The 'order by' clause 
makes optimization easier because it relates the order of the output 
directly to the order of the input sequences of a FLWOR expression.
sort by (), on the other hand, requires an XQuery implementation to look at 
an element constructor in a return clause and determine the source of each 
piece of information before it can leverage indexes in the input source. I 
have not found a general algorithm to do this.

>To summarize: I fail to see what common problem "order by" is supposed
>to solve.  If you want to solve a problem our users actually do have,
>please spend your (limited) time on creating "group by" instead.

I'm still not at all sure what a 'group' is or should be in the XQuery data 
model, or what class of problems your users want solved under the concept 
of 'group by'. Could you fill me in on how you see this? I'm not at all 
sure that we have time to consider new features at this point, but 
regardless of when we look at this, the more information we have, the 
better off we are.

Jonathan

Received on Monday, 18 November 2002 15:26:45 UTC