Hi Christian,
the issue showed up again, this time outside of a function. The computer was only moderately charged, but the change of behavior occurred after I loaded a 25MB text file into Notepad++. Should I change something in the JVM settings?
Kind regards,
Goetz
-----Ursprüngliche Nachricht----- Von: Christian Grün [mailto:christian.gruen@gmail.com] Gesendet: Mittwoch, 25. März 2015 11:27 An: Goetz Heller Betreff: Re: [basex-talk] Simple xQuery functions do not work as expected
P.S.: Please make sure that our conversation appears at BaseX-Talk since I'm receiving mails from other members of the community who do appear to not be informed about the current status.
I continued to write directly to you, because your second e-mail was not directed to the list anymore. It makes perfectly sense to include the list as well.
-----Ursprüngliche Nachricht----- Von: Christian Grün [mailto:christian.gruen@gmail.com] Gesendet: Mittwoch, 25. März 2015 09:38 An: Goetz Heller Betreff: Re: [basex-talk] Simple xQuery functions do not work as expected
However, I would not consider this issue as resolved.
Obviously yes.
For me it is a hint that under heavy load (memory), such misbehavior might occur, and therefore some investigations make sense in my opinion.
I was surprised to hear that a restart of your machine solved the problem, because the GUI is nothing else than a plain JVM instance with a low memory footprint (at least for queries like the one you sent to me).
As I cannot remember to have encountered a similar problem, we rely on your feedback. Feel free to send us some more examples if the problem should decide to haunt you.
Best, Christian
Kind regards,
Goetz
-----Ursprüngliche Nachricht----- Von: Christian Grün [mailto:christian.gruen@gmail.com] Gesendet: Dienstag, 24. März 2015 17:12 An: Goetz Heller Betreff: Re: [basex-talk] Simple xQuery functions do not work as expected
I am using Windows as well.
Does the problem also happen with the latest snapshot? Could you try the zip distribution?
http://files.basex.org/releases/latest/
On Tue, Mar 24, 2015 at 5:07 PM, Goetz Heller heller@hellerim.de wrote:
Did you try it on the Windows platform already? Maybe there was a mistake when packaging.
Kind regards,
Goetz
-----Ursprüngliche Nachricht----- Von: Christian Grün [mailto:christian.gruen@gmail.com] Gesendet: Dienstag, 24. März 2015 16:50 An: Goetz Heller Betreff: Re: [basex-talk] Simple xQuery functions do not work as expected
Strange. Do you possibly have an empty or out-dated database named "labels"? If yes, could you try to back up and delete it, and run the query again?
On Tue, Mar 24, 2015 at 4:45 PM, Goetz Heller heller@hellerim.de wrote:
Hi Christian,
here ist he complete output. Apparently, it's over-optimized:
Result:
<r>et | </r>
Compiling:
- pre-evaluating doc("C:\test\labels.xml")
- applying attribute index for $key_0
- applying attribute index for "_and"
- inlining local:getLabel#2
- removing redundant $key_4 as xs:string* cast.
- removing redundant $lang_5 as xs:string* cast.
- inlining $key_4
- inlining $lang_5
- removing unknown element/attribute TERM
- pre-evaluating db:attribute("Labels",
"_and")/self::*:label/parent::*:LABEL/()/text()
- pre-evaluating ((: xs:string*, true :) ())
- simplifying flwor expression
- inlining $retVal1_2
- inlining $retVal2_3
- simplifying flwor expression
Query: declare variable $labels := doc('C:\test\labels.xml'); declare function local:getLabel( $key as xs:string*, $lang as xs:string* ) as xs:string* { $labels/LABELS/LABEL[@label = $key]/TERM[@LG = $lang]/text() }; let $retVal1 := $labels/LABELS/LABEL[@label = '_and']/TERM[@LG = 'FR']/text() let $retVal2 := local:getLabel('_and', 'FR') return <r>{$retVal1} | {$retVal2}</r>
Optimized Query: element r { (db:attribute("Labels", "_and")/self::*:label/parent::*:LABEL/*:TERM[(@*:LG = "FR")]/text(), " | ", ()) }
Result:
- Hit(s): 1 Item
- Updated: 0 Items
- Printed: 12 Bytes
- Read Locking: global
- Write Locking: none
Timing:
- Parsing: 1.32 ms
- Compiling: 154.5 ms
- Evaluating: 0.43 ms
- Printing: 0.01 ms
- Total Time: 156.26 ms
Query plan:
<QueryPlan compiled="true"> <CElem> <QNm value="r" type="xs:QName"/> <IterPath> <ValueAccess data="Labels" type="ATTRIBUTE"> <Str value="_and" type="xs:string"/> </ValueAccess> <IterStep axis="self" test="*:label"/> <IterStep axis="parent" test="*:LABEL"/> <IterStep axis="child" test="*:TERM"> <CmpG op="="> <CachedPath> <IterStep axis="attribute" test="*:LG"/> </CachedPath> <Str value="FR" type="xs:string"/> </CmpG> </IterStep> <IterStep axis="child" test="text()"/> </IterPath> <Str value=" | " type="xs:string"/> <Empty size="0"/> </CElem> </QueryPlan>
Kind regards,
Goetz