Results 1 to 3 of 3

Thread: database design question

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Apr 2005
    Posts
    127

    database design question

    Let's say I have Type1-Type5 Tables. Each Type has one or more info linked to it. The info table for all 5 types have the same schema. Should I just make one info table and connect the 5 Type tables to it? Or should I make 5 separate info tables, one for each Type.

    Would search speed be faster if I make 5 separate tables?

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: database design question

    What is the data these tables would hold and how would they be linked?

  3. #3
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: database design question

    Your question about faster depends on the number of rows expected and the backend database.

    If you are using MS SQL SERVER for instance then if you decide to make one table for all 5 types then putting the "TYPE" column as the first column and "clustering" the primary key will in effect make it work like 5 separate tables in regard to speed of access to any of the types.

    But if you expect no more than a couple of thousand rows then speed won't be an issue anyway.

    My nature is to make a single table and have a type column - keeping things simple would lead me to that. I dislike designs that have many, many tables - it's confusing and hard to use on the output and query side.

    The fact that all 5 table types have the same schema is a plus in this argument. But I would even create a single table if the 5 schemas didn't match 100% - basically the amount of mismatch has to be large enough before I would consider 5 different tables.

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

Posting Permissions

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



Click Here to Expand Forum to Full Width