Hi Constantine
Just my side note.
As far as I remember, I found this sort of performance discussion with most the XQuery processors I have tested (Sedna, Zorba, Saxon, eXist...). Each time related to sibling, preceding etc. and each time explaining, that indices are not containing pointers for tracking this relationship. My feeling is, this could lead to much bigger index file and slower performance when adding documents and indexing.
My conlcusion is - optimizing this sort of queries has its cost and mostly it is better (and somehow possible) to avoid these constructions.

With best regards

Jan

Ing. Jan Vlčinský
CAD programy
Slunečnicová 338/3, 734 01 Karviná Ráj, Czech Republic
tel: +420-597 602 024; mob: +420-608 979 040
skype: janvlcinsky; GoogleTalk: jan.vlcinsky@gmail.com
http://cz.linkedin.com/in/vlcinsky



On 20 October 2011 15:43, Christian Grün <christian.gruen@gmail.com> wrote:
Hi Constantine,

> The XPath I showed was just a simple example of using the preceding-sibling axis.

I guessed so already.. Thanks for persisting ;)

> I guess what I am asking is ... while most XPath queries I run are quick to resolve, anything using preceding::, preceding-sibling:: or following::, following-sibling:: essentially runs too slowly to be workable - at least, on my sample dataset with about 100K sibling children of the root element.
>
> So is this any sort of known issue? Should I be looking at any sort of configuration options? Is there any way to profile the execution of the Xpath?

It's true that BaseX is mostly optimized for descendant and ancestor
operations. In particular, the preceding/preceding-sibling axes will
always be slower, as our storage does not contain backward pointers to
preceding nodes. I'm pretty sure, though, that there are ways to
either optimize relevant queries or the internal optimizer strategies,
but we'll probably have to spend some more time on analyzing the
relevant bottlenecks..

Feel free to ask for more,
Christian
_______________________________________________
BaseX-Talk mailing list
BaseX-Talk@mailman.uni-konstanz.de
https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk