Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2006
    Posts
    1

    Unanswered: DB design question

    this is what I have now:
    profile table
    recipe table
    photo table (stores path to image on disk)

    profile---1:1---photo table
    recipe----1:5---photo table (upto 5 images per recipe)

    issue:
    most of my pages (other than the main recipe page) just show the first recipe image so the queries are fairly complex and require subqueries to pick the min or creation of temp tables.

    another design option:
    drop the photo table and add 1 field to the profile table and 5 fields to the recipe table with the images. i like this since it simplifies the queries. my only concern is that it may slow things down since the recipe table has 22 fields already. and if we decide to add more pics/recipe than that's even more fields. but i don't think this will slow things down based on what i know (which isn't much!).

    I know either way probably doesn't matter much unless I have a huge # of records but I'm curious.

    Thanks!

  2. #2
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    What is a "Profile"?
    My instinct would be to drop the photo table (I despise 1:1 relationships) and include the file path in the Profile table.
    Do NOT create five columns in your Recipies table to hold the images. I'm not sue exactly what you are trying to accomplish, because I don't know the nature of the data, but if you find yourself creating multiple columns in a single table to hold identical data, you can be sure you are heading down the wrong path.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •