Re: About Saxon XQuery Processor

You may be using the open-source Saxon-HE implementation, which does not have a join optimizer; joins are a great deal faster in the commercial Saxon-EE implementation.

However, all SQL implementations that I know of run on persistent data in a database, and joins usually perform best when you have pre-built indexes on the relevant data fields. There are many XQuery implementations designed to run on a database environment with a similar approach to indexing, and I would expect them to perform equally well. In this respect Saxon is different because it works on ad-hoc XML data files, with no opportunity to build indexes manually in advance. Although Saxon-EE uses indexes to optimize joins, it has to make the indexing decisions itself based on the actual query.

Also, I think the equi-join operation is a lot less important when dealing with hierarchic data (XML) than when dealing with relational data (SQL). Most of the time with XQuery, the relationships you need to use in a query are the hierarchic relationships implicit in the XML, rather than value-based relationships between primary keys and foreign keys. The focus in an optimizer is always on optimizing the constructs that are most used.

Michael Kay
Saxonica


> On 18 May 2015, at 18:48, Yoonmoe Lay <yoonmoelay@gmail.com> wrote:
> 
> Dear everyone,
> 
>             I am a computer science master student from
> Myanmar. Now, I am doing analysis of querying system for SQL and
> XQuery. May I know why XQuery ( that used Saxon) is slower than SQL in
> Join queries? I want also to know why XQuery is faster than SQL expect
> Join queries. Please answer my questions as soon as possible. Thank a
> lot.
> 
> Best Regards,
> Ms. Lwin Moe Aung
> 
> 
> 
> 

Received on Monday, 18 May 2015 20:09:07 UTC