RE: New "order by" clause

At 11:12 AM 11/19/2002 -0700, Jim Davies wrote:
>I don't see it stated explicitly, but I suspect that the motivation for 
>going to "order by" is to allow easy mapping of XQuery expressions onto an 
>underlying relational database.  Would you say that this is the case?

Not only onto relational databases, but also indexes in native XML 
databases. FWIW, I have worked for three different companies that do native 
XML databases, and I care about implementability on both native XML and 
relational stores.

 >  And is that a good rationale for designing a language feature?

Efficient implementability in the range of environments where we expect our 
language to be deployed? Yes, I would say that's a good rationale.

>I found "sortby" (or "sort by") to be intuitively pretty simple, and more 
>general than "order by".  The latter complicates simple queries; I can't say
>
>         document("mystuff.xml")//name sortby(.)

Right, you would say:

for $n in document("mystuff.xml")//name
order by $n/name
return $n

This was discussed at length, and we examined quite a few queries along 
these lines. One proposal was to retain both sort by () and the order by 
clause, defining the one in terms of the other. When the vote came, people 
seemed to prefer having only one way to sort.

Let me make sure I understand your position - would you prefer having two, 
or would you prefer that we remove 'order by' altogether?

Jonathan

Received on Tuesday, 19 November 2002 14:31:09 UTC