Giuseppe,
Grazie per la tua pronta risposta. In the latest snapshot, the last step of a path expression will only be rewritten to the right operand of a map expression if the second last step is guaranteed to yield nodes [1,2].
Gute Nacht, Christian
[1] https://github.com/BaseXdb/basex/commit/a3b3d866925d4908466cc2cd27c7f617dc5e... [2] http://files.basex.org/releases/latest/
On Sat, Jul 7, 2018 at 1:41 AM Giuseppe Celano celano@informatik.uni-leipzig.de wrote:
here's the plan (it actually wrongly translates / into !):
Optimized Query: (element j { ("fgrtu") }/data(.) ! replace(., "g", "h")) Query: <j>fgrtu</j>/data(.)/replace(., "g", "h")
Universität Leipzig Institute of Computer Science, NLP Augustusplatz 10 04109 Leipzig Deutschland E-mail: celano@informatik.uni-leipzig.de E-mail: giuseppegacelano@gmail.com Web site 1: http://www.dh.uni-leipzig.de/wo/team/ Web site 2: https://sites.google.com/site/giuseppegacelano/
On Jul 7, 2018, at 1:25 AM, Christian Grün christian.gruen@gmail.com wrote:
Looks like a too eager optimization. Did you have a chance to look at the resulting query plan?
Giuseppe Celano celano@informatik.uni-leipzig.de schrieb am Fr., 6. Juli 2018, 22:40:
I have noticed that in BaseX 9.0.2 a query like
<j>fgrtu</j>/data(.)/replace(., "g", "h")
gets evaluated (returning "fhrtu"), while in BaseX 8.x, Exist, and Zorba I get an error message (since, as expected, replace() is preceded not by a node but a string).
Is this a bug?
Ciao, Giuseppe