Hi Christian, Thanks for you help, using a singleton structure for the client and using your query, my performances improved a lot. (from 120min to 40s for the whole process)
The suggestion for anyone else having this issue is as always to keep the session till all the requests are done, and not to create a session for every query.
Cheers, F.
Il giorno 23/nov/2015, alle ore 12:06, Christian Grün christian.gruen@gmail.com ha scritto:
Hi Filippo,
Your queries may be executed faster if you rewrite your query to forward axes:
if(direct) { input = "for $n in db:open('" + DBNAME +"', '/" + keyName + "')/descendant::" + element + "/child::*/name()" } else { input = "for $n in db:open('" + DBNAME +"', '/" + keyName + "')//descendant::" + element + "/descendant::*/name()" }
This brings to have for a tree with 7 paths a 7! permutations and therefore at least 7!*4=21.000 queries (the query below) in a lapse of 5minutes.
XQuery is a very powerful language, so I’m more than sure that the problem could be solved much faster if all queries were combined in a single XQuery expression. However, it obviously takes some time to get to know the language..
Hope this helps, Christian