[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Why not reinvent the wheel?

  • From: Joe English <jenglish@f...>
  • To: Vasileios Papadimos <vpapad@c...>, xml-dev@l...
  • Date: Fri, 02 Mar 2001 13:02:48 -0800

Re: Why not reinvent the wheel?

Jonathan Robie wrote:

> Vasileios Papadimos wrote:
>
> >An unordered join would also be associative (right?), and that would turn
> >XML query optimization back into the exponential problem we know and love :-
> )
>
> Your first sentence is something I really want to think about before
> answering. As for your second...well, good query optimization is going to
> be important.


Ordered and unordered joins are both associative, in the sense that:

    [(x1,x2,x3) | x1 <- e1, (x2,x3) <- [(x2,x3) | x2 <- e2, x3 <- e3]]
==
    [(x1,x2,x3) | (x1,x2) <- [(x1,x2) | x1 <- e1, x2 <- e2], x3 <- e3]


Unordered joins however are commutative:

    FOR x1 in e1, x2 in e2 RETURN ...
==
    FOR x2 in e2, x1 in e1 RETURN ...

This is what opens up more possibilities for optimizations;
it holds for unordered joins, but not for ordered ones.

The exponential-time problem Vasileios refers to is in the size
of the query, but since it can give you a polynomially-sized
time reduction in the size of the _input_, it's usually worth
doing.

It seems to me that unordered sequences ought to be the default
in XQuery, not ordered ones.  As long as there is an option to
sort the result by document position, nothing is lost, but there
is much to be gained.


--Joe English

  jenglish@f...

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.