Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Optimising XPATH search performance

From: "Joe Fawcett" <joefawcett@-------.--->
To: NULL
Date: 12/3/2004 12:35:00 PM
"James Hahn" <JamesHahn@h...> wrote in message 
news:e1ylfOO2EHA.3336@T......
>I am processing an XML file where performance is important. Most of the 
>searching is for an element within the current node, but there is one point 
>where I have to do a SelectSingleNode from the document root, searching for 
>a unique ID, and I suspect this is a slow procedure.
>
> Does anyone know if there's a performance difference if this ID is an 
> attribute or an element? Is there any optimising I can do to ensure the 
> search is as efficient as possible?
>
> I could pre-process the file to de-normalize it, but for a typical data 
> set this about quadruples the size, and I fear that I will not get any 
> overall speed improvement.
>

In theory if the ID is declared as type ID in a DTD, and therefore an 
attribute, it will be found quicker. As Jonathon mentioned though an 
empirical test is fairly straightforward.

-- 

Joe (MVP - XML) 




transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent