I have already seen a few questions on this topic, but I'm looking for some idea of โโthe performance differences between the two methods.
For example, let's say I write a log of events that will log into the system with a vocabulary of key / value pairs for a particular event. I will write an entry to the Events table with the underlying data, but then I need a way to also associate additional key / value data. I will never know which keys or values โโwill come, so any predefined enumeration table is out of the question.
The data from this event will be constantly broadcast, so insertion time is as important as request time.
When I request specific events, I will use some fields in the event, as well as data from key / value data. For the XML method, I would simply use the Attributes.exists ('xpath') operator as part of the where clause to filter records.
The normalized way is to use a table with the Key and Value fields with an external link to the Event record. It seems clean and simple, but I'm worried about the amount of data that is involved.
performance database xml sql-server xpath
Vyrotek
source share