Thanks for answer, but the problem comes from the use or not of the attributes index. My collection : Propriétés de la base de données Nom: FichiersBase Taille: 16425 MB Noeuds: 149424611 Documents: 6200 Binaires: 0 And i have 6,426,118 node with an @id. And for example, I discover that : $r := collection("FichiersBase")//*[@id='R1C862AF55D1BEBC-EFL']/base-uri() doesn't use the attribute index, but $v := collection("FichiersBase")//*[@id='R1C862AF55D1BEBC-EFL'] $r := $v/base-uri() uses it.
And after that, as the optimizer use the statistics of database, I have to analyze the query in real case, because I do a query with test data, I obtain a QueryPlan, and when I use the real data I have an other one, specially in the case where a collection as only one file, but in some other case too I think. Thats why if the QP should be output before the calculation of the query it will be better.
I have a question about the attribute index, does it will be better if I do a collection with only node with the @id attribute and the data I need in my queries, no other data (text(), unsual attribute etc.)? For example I do a map at the beginning of the query to "load" the part of the attribute index I use in memory, so my query takes always the same time else sometimes it takes a long time to read the attribute index. let $map-id := map:new (for $id in (collection("FichiersBase")//*[@id]) return (map:entry($id/@id, $id))) ....... $elem-bu := map:get($map-id,$link-bc/@linkid), $ok := concat("FichiersBase/",$nomf) = $elem-bu/base-uri()
Marc
Le vendredi 4 juillet 2014 22:14:10, Christian Grün a écrit :
Hi Marc,
The problem is that the xquery is so long that's it drops in time out, and in this case I don't have the QP.
Do you have any guess what takes most time? Is it really the transfer of the query string to the server, or is it the time for parsing and/or compiling the query? Do you use the default timeout of 30 seconds?
If you want, you can pass us on the query string, we can then have a look.
Cheers, Christian