Hi Cerstin,
However, my real data has about 140 000 of such entries and about 30 000 of such secondqueries, it's all in one database. Which is probably too big.
true; it may well be that the total amount of update operations is too large to be processed in a single step. I would advise to try to run the updates in several steps und trigger several query executions, à la…
declare variable $start external := 1; declare variable $end external := 1000;
for $entry in db:open("collection-ws-new.xml")/descendant::entry[position() = $start to $end] let $next := $entry/following-sibling::entry[1] let $sc := $entry/following-sibling::secondquery[empty($next) or . << $next] return (insert node $sc into $entry, delete nodes $sc)
After 3320855 ms of execution time (and 3355613 ms for a second attempt) I got the following error message. Any ideas?
Did you stop the update process, and do you still have the original data instance?
The error messages indicates that the updatable index structure could be corrupt. You could try to export your data and create a new database without updatable index structures; this could also speed up your updates. Maybe it even allows you to update all nodes in a single run.
Christian ___________________________
I already set VM=-Xmx1024m and I use BaseX 7.6.1 Beta from February 14 on a MacBook Air with a 2 GHz processor and 8 GB RAM.
Error: Improper use? Potential bug? Your feedback is welcome: Contact: basex-talk@mailman.uni-konstanz.de Version: BaseX 7.6.1 beta Java: Apple Inc., 1.6.0_43 OS: Mac OS X, x86_64
Stack Trace: java.lang.ArrayIndexOutOfBoundsException: 2147483647 org.basex.io.random.TableDiskAccess.cursor(TableDiskAccess.java:485) org.basex.io.random.TableDiskAccess.read5(TableDiskAccess.java:211) org.basex.data.Data.textOff(Data.java:422) org.basex.data.DiskData.text(DiskData.java:234) org.basex.index.value.DiskValues.readKeyAt(DiskValues.java:285) org.basex.index.value.DiskValues.get(DiskValues.java:441) org.basex.index.value.UpdatableDiskValues.index(UpdatableDiskValues.java:65) org.basex.data.DiskData.indexEnd(DiskData.java:355) org.basex.data.Data.insert(Data.java:841) org.basex.data.atomic.Insert.apply(Insert.java:31) org.basex.data.atomic.AtomicUpdateList.applyStructuralUpdates(AtomicUpdateList.java:297) org.basex.data.atomic.AtomicUpdateList.execute(AtomicUpdateList.java:285) org.basex.query.up.DatabaseUpdates.apply(DatabaseUpdates.java:183) org.basex.query.up.ContextModifier.apply(ContextModifier.java:90) org.basex.query.up.Updates.apply(Updates.java:120) org.basex.query.QueryContext.update(QueryContext.java:270) org.basex.query.QueryContext.value(QueryContext.java:255) org.basex.query.QueryContext.iter(QueryContext.java:240) org.basex.query.QueryContext.execute(QueryContext.java:498) org.basex.query.QueryProcessor.execute(QueryProcessor.java:96) org.basex.core.cmd.AQuery.query(AQuery.java:77) org.basex.core.cmd.XQuery.run(XQuery.java:22) org.basex.core.Command.run(Command.java:342) org.basex.core.Command.exec(Command.java:321) org.basex.core.Command.execute(Command.java:78) org.basex.gui.GUI.exec(GUI.java:397) org.basex.gui.GUI$7.run(GUI.java:349)
Compiling:
- simplifying descendant-or-self step(s)
Optimized Query: for $entry in document-node { "collection-ws-new.xml" }/descendant::entry let $next := $entry/following-sibling::entry[1] let $sc := $entry/following-sibling::secondquery[(fn:empty($next) or (. << $next))] return (insert node $sc into $entry, delete nodes $sc)
-- Dr. phil. Cerstin Mahlow
Universität Basel Departement Sprach- und Literaturwissenschaften Fachbereich Deutsche Sprach- und Literaturwissenschaft Nadelberg 4 4051 Basel Schweiz
Tel: +41 61 267 07 65 Fax: +41 61 267 34 40 Mail: cerstin.mahlow@unibas.ch Web: http://www.oldphras.net
BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk