I had a typo in my example. The return did not call the map2 version. With
it, the results were (now on 7.7 and Windows 7)
And I posted the wrong version. Usage of ! within map:new() is not as
fast as a flowr expression (in general).
BUT neither of the “fastest two” functions yields valid
Thanks Arto for the interesting comparisons.
One more rewriting for map2 could be..
declare function local:map2($a, $b) {
let $m2 := map:new($b ! map:entry(., true()))
return $a[$m2(.)]
};
..but my assumption is that all rewritings should yield similar
performance, because the flwor
Hej Arto,
just being interested:
How does it compare to a FLOWR expression?
declare function local:difference-flowr($a, $b) {
for $x in $a
where not($x = $b)
group by $x
return $x[1]
};
cheers
Arve
Am 25.09.13 07:22 schrieb Arto Viitanen:
Question was about set operations in BaseX. I
-Original Message-
From: Arve Gengelbach [mailto:a...@basex.org]
Sent: 25. syyskuuta 2013 9:08
To: Arto Viitanen
Cc: basex-talk@mailman.uni-konstanz.de
Subject: Re: [basex-talk] Set Operator Examples
Hej Arto,
just being interested:
How does it compare to a FLOWR expression?
declare
-talk] Set Operator Examples
Hej Arto,
just being interested:
How does it compare to a FLOWR expression?
declare function local:difference-flowr($a, $b) {
for $x in $a
where not($x = $b)
group by $x
return $x[1]
};
pred 51787.06 ms
map 485.16 ms
map2 325.09 ms
flowr
...@basex.org]
Sent: 25. syyskuuta 2013 9:08
To: Arto Viitanen
Cc: basex-talk@mailman.uni-konstanz.de
Subject: Re: [basex-talk] Set Operator Examples
Hej Arto,
just being interested:
How does it compare to a FLOWR expression?
declare function local:difference-flowr($a, $b) {
for $x
I had a typo in my example. The return did not call the map2 version. With it,
the results were (now on 7.7 and Windows 7)
- pred 58278.25 ms
- map 272.68 ms
- map2 74.27 ms
- map2! 92.97 ms
- flowr 43018.3 ms
Hej Arto,
One can even improve your map2 by using the [Simple map operator].
Hi all,
Where can I find examples using set operators... wrt BaseX.
--
Have a nice day
JBest
___
BaseX-Talk mailing list
BaseX-Talk@mailman.uni-konstanz.de
https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
Hi John,
XQuery defines three set operators, namely union, intersect and
except. As those are not BaseX-specific, you’ll need to check out
other literature on XQuery
Hope this helps,
Christian
___
2013/9/24 John Best johnbest5...@gmail.com:
Hi all,
Where can I find
9 matches
Mail list logo