|
[XQuery Talk Mailing List Archive Home] [By Date] [By Thread] [By Subject] [By Author] [Recent Entries] [Reply To This Message] Perfomance ProblemMichael Kay mike at saxonica.comMon Feb 22 15:26:34 PST 2010
Performance always depends on the processor you are using. This query will
be inefficient using a processor (such as Saxon-HE) that does serial search
to implement
$coleccion_cod-agrupa_xi/BLOQUE_CODAGRUPA[AGRUPA1=$distinct_agrupa1
and it will be much more efficient on one (such as Saxon-EE) that optimizes
this expression using indexing or hash tables.
As an alternative to finding a processor with a suitable optimizer, you
could look for one that implements the XQuery 1.1 "group by" construct, or
an equivalent vendor extension. (Again, Saxon-EE fits the bill).
Or you could use XSLT 2.0, which has the convenient <xsl:for-each-group>
construct as standard.
Regards,
Michael Kay
http://www.saxonica.com/
http://twitter.com/michaelhkay
_____
From: http://x-query.com/mailman/listinfo/talk [mailto:http://x-query.com/mailman/listinfo/talk] On Behalf
Of Julio de la Vega
Sent: 22 February 2010 14:45
To: http://x-query.com/mailman/listinfo/talk
Subject: Perfomance Problem
Hi *,
I have problems with performance in the next xQuery
let $doc := doc("/Lib/doc)
let $res := document {
<root>
{
let $coleccion_cod-agrupa_xi := document
{
for $XI in $doc/root/XI
return
(
<BLOQUE_CODAGRUPA>
<AGRUPA1>{concat($XI/R00000/COD-ENT-GR, $XI/R00000/N-INT-PERS,
$XI/R00000/N-ITN-DIRE )}</AGRUPA1>
<AGRUPA2>{concat($XI/R00000/COD-ENT-GR, $XI/R00000/N-ITN-DIRE, "-2"
)}</AGRUPA2>
<AGRUPA3>{concat($XI/R00000/COD-ENT-GR, $XI/R00000/N-ITN-DIRE, "-3"
)}</AGRUPA3>
</BLOQUE_CODAGRUPA>
)
}
return
for $distinct_agrupa1 in
distinct-values($coleccion_cod-agrupa_xi/BLOQUE_CODAGRUPA/AGRUPA1)
return
<TERCIOS>
<AGRUPA1>{$distinct_agrupa1}</AGRUPA1>
<AGRUPA2>{$coleccion_cod-agrupa_xi/BLOQUE_CODAGRUPA[AGRUPA1=$distinct_agrupa
1][1]/AGRUPA2/text()}</AGRUPA2>
</TERCIOS>
}
</root>
}
return $res/root
How could I get AGRUPA2 without reading again all the information from
$coleccion_cod-agrupa_xi?
<AGRUPA2>{$coleccion_cod-agrupa_xi/BLOQUE_CODAGRUPA[AGRUPA1=$distinct_agrupa
1][1]/AGRUPA2/text()}</AGRUPA2>
Any ideas?
Thank you
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://x-query.com/pipermail/talk/attachments/20100222/69df87bb/attachment-0001.htm
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








