Reputation: 13437
what is a good solution for get best performance of SELECTing XML fields?Cosider a table with 100000 record.If I select all table content and create a table variable and then create index on it and then calculate values on it ? or create several index on my xml field and then calculate values?
If any one has better solution please say.
thanks
Upvotes: 0
Views: 254
Reputation: 754268
If you need to extract only certain single values from your XML, you could also investigate this approach:
INT
or a VARCHAR
or somethingOnce you have a computed, persisted column, you can easily index that column.
Unfortunately, this only works if you need to extract a single piece of information from your XML column - it doesn't work if you need to extract an entire list of values from the XML
If you need to extract lists of information, then your only real option would be XML indices. In our experience, though - the overhead (in terms of disk space) is extremely high - a database we had went from about 2 GB to over 10 GB when we added a single XML index....... it's an option and you could try it - but be aware of the potential downsides, too.
Upvotes: 3