The erroneous index rewriting has been resolved (it only occurred if downward and upward attribute axes were mixed) [1]. A new snapshot is available [2].
Cheers, Christian
[1] https://github.com/BaseXdb/basex/issues/1490 [2] http://files.basex.org/releases/latest/
On Sun, Aug 20, 2017 at 5:17 PM, Christian Grün christian.gruen@gmail.com wrote:
Hi Nikos,
I had a look at the optimized query plans. Apparently, one of the index rewriting rules composes the inversed path in a wrong way:
db:open('bug')//@a/..[@* = "x"]
…is rewritten to…
db:attribute("bug", "x")/..[a/..]
…while it should be…
db:attribute("bug", "x")/..[@a/..]
…or (further optimized)…
db:attribute("bug", "x")/..[@a]
I have created a new issue [1], maybe I can fix it tomorrow.
Thanks, Christian
[1] https://github.com/BaseXdb/basex/issues/1490
On Sun, Aug 20, 2017 at 3:29 PM, nikos dimitrakas nikos@dsv.su.se wrote:
Hi! I discovered a strange behavior i BaseX (8.6.5): I evaluate //S/@k/parent::* or //S/@k/.. and it works I evaluate //S[.//@m="V"] and it works But when I evaluate //S/@k/parent::*[.//@m="V"] or //S/@k/..[.//@m="V"] it does not work. There is no error, just no result. At first I thought that there was an error with going to a parent of an attribute node, but that works. Then I thought the problem was with ".//@" in the predicate, but that also works. It appears that it is the combination that confuses the engine.
Here is an xml to test the above expressions:
<Root> <B> <S k="AAA"> <P m="V" a="1000"/> <P m="V" a="800"/> <P m="G" a="1000"/> <P m="E" a="900"/> </S> <S k="AA"> <P m="V" a="2000"/> <P m="G" a="2500"/> <P m="E" a="2900"/> </S> <S k="D"> <P m="V" a="4000"/> </S> <S k="C"> <P m="V" a="4000"/> <P m="G" a="4000"/> </S> </B> <B> <S k="AAA"> <P m="V" a="1200"/> <P m="V" a="800"/> <P m="G" a="1200"/> </S> <S k="AA"> <P m="V" a="2900"/> </S> <S k="C"> <P m="G" a="5400"/> </S> </B> <B> <S k="AAA"> <P m="V" a="1100"/> <P m="E" a="900"/> </S> <S k="AA"> <P m="V" a="2700"/> <P m="G" a="2500"/> </S> </B> </Root>
I hope you can find the problem and fix it in a new version soon.
Regards /nikos