|
From: Luca C. <cer...@gm...> - 2009-06-04 08:52:25
|
Dear all, I have a problem while trying to query my documents set using attributes. (Note that I'm working on 30000) documents. If I do something like this: declare namespace nir="http://www.normeinrete.it/nir/2.0"; declare namespace xlink="http://www.w3.org/1999/xlink"; declare namespace dsp="http://www.normeinrete.it/nir/disposizioni/2.0"; declare namespace functx = "http://www.functx.com"; for $docs in collection('/db/test')//nir:articolato let $integrazioni := $docs//nir:inlinemeta/nir:disposizioni/nir:modificheattive/dsp:integrazione/dsp:pos/@xlink:href/substring(.,2) let $documentURN := $docs/ancestor-or-self::nir:NIR//nir:urn let $partizioni := $docs//nir:* where count($docs//nir:modificheattive) > 0 and count($integrazioni) > 0 and $integrazioni != '' and $integrazioni != 'blc-modificazioni' and $integrazioni != 'blc-dispositivo' return <div urn="{$documentURN}"> { for $integrazione in $integrazioni return <p>{$integrazione}</p> } </div> Everything works fine. I found 583 results in about 2 seconds. But If I try to change this line: let $partizioni := $docs//nir:* To this: let $partizioni := $docs//nir:*/@id The query is very very slow. Is there a way to optimise the queries on the attributes in eXist+xquery? Thanks for any reply. Luca Cervone -- View this message in context: http://www.nabble.com/Very-slow-queries-on-attributes-tp23866133p23866133.html Sent from the exist-open mailing list archive at Nabble.com. |