Which one is better, XML-DML or normal update
I want to save xml data with the following structure in the database
<root>
<static>...</static>
<dynamic>...</dynamic>
</root>
Each subnode, static and dynamic, can contain a lot of child nodes. The static part will remain unchanged once created, but the dynamic part will change with each update. I have two solutions,
1. save everything in a single xml column, then use xml dml to update the dynamic part, but for each update, two actions are needed.
update mytable set @xml.modify('delete ...') followed by update mytable set @xml.modify('insert...')
2. store static and dynamic into two separate columns, and use normal update statement to replace dynamic column as a whole for each update
I would like to know which solution will give better performace based on your experience. Any comments are welcome.
[894 byte] By [
wuboyan] at [2007-12-24]
Jinghao Liu wrote: |
As for now, SQL-DML is better than XML-DML in terms of performance. So the second solution is better choice for you. |
|
And do you have any ideas: when the performance of XML-DML might be improved? In what release or whatever?
Our problem is that we've finished a lot of functionality already using XML-DML, and we faced the performance problems too :) So what I'd like to know: whether to look for temporary workarounds and wait for new release, or to remake it using other technology?
Thanks in advance!
Please submit your request - need to improve XML-DML performance - through http://connect.microsoft.com/sqlserver. It will increase the chance to get imporve for next release.
If you can provide your data and the queries which you think they are slow to us, it will also help us to isolate the problem or even provide you some advice. You can contact me at jinghaol@microsoft.com.
Jinghao Liu