Suppose i've one table that holds Blogs. The schema appears like :

ID (int)| Title (varchar 50) | Value (longtext) | Images (longtext)| ....

Within the area Images i store an XML Serialized Listing of images which are connected using the blog.

Must i use another table for this function?

Yes, you need to place the images in another table. Getting several values within the same area signifies denormalized data and causes it to be hard to utilize the database.

As with every rules, you will find exceptions where it seems sensible to place XML with multiple values in a single area within the database. The very first rule is the fact that:

The information should always read/written together. You don't need to read or update one of the values.

If that's satisfied, there might be numerous good reasons to place the data together in a single area:

  • Storage efficiency, if space has demonstrated to become a problem.
  • Retrieval efficiency, if performance has demonstrated to become a problem.
  • Schema flexilibity where one XML area can eliminate hundreds or 100s of various tables.

I'd certainly use another table. If you are using XML, what goes on when you really need to undergo increase the references to any or all images? (Can you just rather do an Update blog_images Set ..., or parse with the XML for every row, result in the update, then re-create the up-to-date XML for every?

Well, it's a little "inner platform", however it works. Another table allows better image querying, although on some RDBMS platforms this may be accomplished with an XML-type column and SQL/XML.

If the data only needs to be opaque storage, maybe. However, bear in mind you'll have to regenerate the whole XML towards the application-tier to complete anything interesting by using it (or: based on platform, use SQL/XML, however i advise from this, because the DB is not the area to complete such processing generally).

My advice in most other cases: separate table.

That is dependent on whether you'd have to query around the actual image data itself. If you notice a potential have to query on certain images, or images with certain characteristics, it would most likely be better to store that image data in different ways.

Otherwise, let it rest the actual way it is.

But don't forget, only range from the fields inside your Choose when you really need them.

Must i use another table for this function?

Not always. You just need to ensure that you're not choosing the pictures area inside your queries when you do not need it. But when you desired to denormalize your schema you could utilize another table and when you really need the pictures execute a join.