Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries >Thread Prev - Optimising XPATH search performance [Thread Next] Re: Optimising XPATH search performanceTo: 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) | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
