Namespaces, replace, and performance

Thursday, 17 February 2022 · 2 messages
CG
Christian Grünin reply to Jonathan Robie, 17 Feb 2022, 14:4617 Feb 2022 14:45 #
Hi Jonathan, The query may run faster if the namespaces are declared in one of the ancestor elements. Otherwise, they need to be re-declared many times in the XML structure, and that takes additional time and memory. Still, it’s difficult to make generalized statements about execution times with or without namespaces … Best, Christian
Quoted text · Jonathan Robie · 9 lines
On Thu, Feb 17, 2022 at 1:46 PM Jonathan Robie <jonathan.robie at gmail.com> wrote: > > I wrote a query that replaced roughly 470153 text nodes with an element that had two namespaces declared on it. It ran for several hours. > > I didn't need or want these namespaces, they were in the original source. I rewrote the query to remove the namespaces from these nodes before replacing the text node. I don't know how quickly it ran, but I think not more than 15 minutes, the first time I checked on it, it had already finished. I made no other changes to the query. > > Is this surprising? Or is this a general lesson about performance and updates that add namespaces low down in the hierarchy? Or ... > > Jonathan
JR
Jonathan Robie17 Feb 2022 14:46 #
I wrote a query that replaced roughly 470153 text nodes with an element that had two namespaces declared on it. It ran for several hours. I didn't need or want these namespaces, they were in the original source. I rewrote the query to remove the namespaces from these nodes before replacing the text node. I don't know how quickly it ran, but I think not more than 15 minutes, the first time I checked on it, it had already finished. I made no other changes to the query. Is this surprising? Or is this a general lesson about performance and updates that add namespaces low down in the hierarchy? Or ... Jonathan

⚡Generated with XQuery