logo       

Re: XQuery coding style: nested FLWOR expressions: msg#00029

Subject: Re: XQuery coding style: nested FLWOR expressions
I think that if a language allows users to specify queries in different
ways, users will tend to do so. Many people indeed do know SQL and will
tend to shape their queries accordingly. I used to do it myself when
learning XQuery and I see many students doing it when teaching XQuery. 

You should also consider the fact that not all queries come from users.
Some queries will be generated and in it is likely that in those cases,
many of the queries will be overly verbose. In that sense, I think this
particular XMark query may be a good test for XQuery optimizers.

Philippe

On Wed, 2006-04-12 at 09:16 +0100, Michael Kay wrote:
> I've been looking again recently at some of the XMark benchmark queries.
> 
> I'm wondering what it is about the language that makes people write things
> like this (Q9):
> 
> for $p in /site/people/person
> let $a := for $t in /site/closed_auctions/closed_auction
>           let $n := for $t2 in /site/regions/europe/item
>                        where  $t/itemref/@item = $t2/@id
>                        return $t2
>              where $p/@id = $t/buyer/@person
>              return <item> {$n/name} </item>
> return <person name="{$p/name}">{ $a }</person>
> 
> when they could have written
> 
> for $p in /site/people/person
> return <person name="{$p/name}"> { 
>   for $t in /site/closed_auctions/closed_auction[buyer/@person = $p/@id]
>   return <item> {/site/regions/europe/item[@id = $t/itemref/@item]/name}
> </item> 
> } </person>
> 
> Is it just a torture test for optimizers? Did the author think this was the
> best/easiest way to write the query? Does anyone else think it is? Is it the
> way SQL users' brains are wired?
> 
> Michael Kay
> http://www.saxonica.com/ 
> 
> 
> _______________________________________________
> talk-KUd/JJajPrLQT0dZR+AlfA@xxxxxxxxxxxxxxxx
> http://xquery.com/mailman/listinfo/talk
-- 
Philippe Michiels (PhD Student)
Advanced Database Research and Modeling
University of Antwerp
t: +32 3 265 38 80
w: http://www.adrem.ua.ac.be/~michiels



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
region.costa-ri...    user-groups.lin...    lang.prothon.us...    xfree86.cvs/200...    finance.aqbanki...    ietf.smtp/1993-...    web.turbogears....    jakarta.cactus....    yellowdog.gener...    php.gtk+.genera...    org.region.indo...    hurd.l4/2005-10...    culture.religio...    apple.fink.gene...    db.mysql.window...    bluez.devel/200...    security.pgp-ba...    video.blender.d...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe