Note that there are some explanatory texts on larger screens.

plurals
  1. POEfficient storing item info and item data in the same table?
    primarykey
    data
    text
    <p>I have a site where users can save images together with a couple of info fields about the image. The images are stored as binary data in the same table as the rest of the image info. So far pretty standard. </p> <p>Now, the users should be able to upload a document, describing the image in more detail, along with the rest of the image and its' info. <em>Size ~2MB per document</em>. </p> <p><strong>My question is:</strong> Should I store this document (binary data) in the same table as the rest of the images or should I create a new table holding only the documents. There would of course be an id reference in the image table to the document in the document table. </p> <p>I have a search function joining a couple of tables, including the image table, when searching for images. I need to know if there's a difference in efficiency between these two solutions.<br> I always fetch the document data separately but if I don't win anything in having the documents in a separate table I'll just put it with the rest of the image info. </p> <p>I'm asking this since I don't really know how SQL Server handle tables when joing and searching in them.</p> <p>I have about 10´000 users with a maximum of 10 images per user. (ASP.NET - SQL Server)<br> (I'm not asking <strong>if</strong> I should store documents in the database, but how ;) </p> <p>Thanks in advance! </p> <p>/zalk</p> <p><strong>Edit</strong><br> Example 1:<br> columns in imageTable - id, title, dateAdded, image (binary data), document (binary data)</p> <p>Searching for items from a specific user I would join the userTable and the imageTable and select title where image id equals user id. </p> <p><strong>So, will there be any difference in the performance if the document is in the imageTable or in an own table?</strong></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload