Howdy, all --
If I run the following query against a large, full-text-indexed store (output from "svn log --xml" on a repository with several hundred thousand entries), I get results back in well under a second:
count(/log/logentry[./paths/path/text() contains text "trunk"])
However, the following variant takes multiple minutes to execute -- actually, has never yet completed before I've lost patience and cancelled it:
count(/log/logentry[ ./paths/path/text() contains text "trunk" and not( (./paths/path/text() contains text "tags") or (./paths/path/text() contains text "branches") ) ])
Is there a way to get reasonable(ish) performance for the more complex query?
count(/log/logentry[ ./paths/path/text() contains text "trunk" and not( (./paths/path/text() contains text "tags") or (./paths/path/text() contains text "branches") ) ])
what about
let $trunk := /log/logentry[ paths/path/text() contains text "trunk"], $tags := /log/logentry[ paths/path/text() contains text "tags"], $branches := /log/logentry[ paths/path/text() contains text "branches"]
return $trunk except ($tags|$branches)
Liam’s solution should do all you need. You may as well want to try a combination of ftand/ftor:
count(/log/logentry[ paths/path/text() contains text "trunk" ftand ftnot("tags" ftor "branches") ]) ___________________________
On Thu, Jan 24, 2013 at 12:52 AM, Liam R E Quin liam@w3.org wrote:
count(/log/logentry[ ./paths/path/text() contains text "trunk" and not( (./paths/path/text() contains text "tags") or (./paths/path/text() contains text "branches") ) ])
what about
let $trunk := /log/logentry[ paths/path/text() contains text "trunk"], $tags := /log/logentry[ paths/path/text() contains text "tags"], $branches := /log/logentry[ paths/path/text() contains text "branches"]
return $trunk except ($tags|$branches)
-- Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/ Pictures from old books: http://fromoldbooks.org/ Ankh: irc.sorcery.net irc.gnome.org freenode/#xml
BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
basex-talk@mailman.uni-konstanz.de