Hi,
I have an xml file consisting (only) of many elements similar to this
<re> <de>something</de> <se>something</se> <id>something</id> <p>something</p> <s>something</s> <h>something</h> <b>something</b> <m>something</m> </re>
and a simple query like this
let $t := doc("file.xml") for $a in $t//re let $b := $a/de let $c := $a/se return (element r {attribute f {$b || "-" || $c}, <i>{$a/id/data(.)}</i>, <f>{$b/data(.)}</f>, <p>{$a/p/data(.)}</p>, <l>{$c/data(.)}</l>, <s>{$a/s/data(.)}</s> ,<h>{$a/h/data(.)}</h>, <b>{$a/b/data(.)}</b>, <m>{$a/m/data(.)}</m> })
I have noticed that while the preceding query works fine, if I substitute all the elements in it (e.g, <s>{$a/s/data(.)}</s>) with their contents ($a/s/) (i.e., I expect that the exact same element of the document is inserted), BaseX gets out of main memory. Any explanation? Thanks.
Joseph
I have noticed that while the preceding query works fine, if I substitute all the elements in it (e.g, <s>{$a/s/data(.)}</s>) with their contents ($a/s/) (i.e., I expect that the exact same element of the document is inserted), BaseX gets out of main memory. Any explanation? Thanks.
Some executable code would be helpful.
Thanks, Christian
Hi Christian,
The code I sent is actually working code. The data however are many files. I do not know whether it depends on the amount of data (800 mb) or on the query itself. In general, I was wondering whether there may be a performance difference between using an explicit element constructor (e.g, <s>{$a/s/data(.)}</s>) and adding an element already contained in the document ($a/s, which evaluates to the same element as the above). Thanks.
Il giorno 15 mar 2017, alle ore 20:49, Christian Grün christian.gruen@gmail.com ha scritto:
I have noticed that while the preceding query works fine, if I substitute all the elements in it (e.g, <s>{$a/s/data(.)}</s>) with their contents ($a/s/) (i.e., I expect that the exact same element of the document is inserted), BaseX gets out of main memory. Any explanation? Thanks.
Some executable code would be helpful.
Thanks, Christian
I was wondering whether there may be a performance difference between using an explicit element constructor (e.g, <s>{$a/s/data(.)}</s>) and adding an element already contained in the document ($a/s, which evaluates to the same element as the above). Thanks.
In both cases, nodes will need to be duplicated (due to the memory consuming semantics of the XQuery specification), so there should be no big difference.
As you have observed (if I got you right) that only one of your queries is getting out of memory, you may need to provide us with both queries.
Are you working with the BaseX GUI, on command-line, or with any other API?
BaseX GUI. I start with it all the times.
Il giorno 17 mar 2017, alle ore 17:36, Christian Grün christian.gruen@gmail.com ha scritto:
I was wondering whether there may be a performance difference between using an explicit element constructor (e.g, <s>{$a/s/data(.)}</s>) and adding an element already contained in the document ($a/s, which evaluates to the same element as the above). Thanks.
In both cases, nodes will need to be duplicated (due to the memory consuming semantics of the XQuery specification), so there should be no big difference.
As you have observed (if I got you right) that only one of your queries is getting out of memory, you may need to provide us with both queries.
Are you working with the BaseX GUI, on command-line, or with any other API?
basex-talk@mailman.uni-konstanz.de