Table Creation

  • Hi guys,

    I have a quick question that i'd like to get your opinions on.

    Basically we're looking at designing a table for a new system called container, a container can be one of about 15 things and one container can contain many others or different types.

    My question is, do you think we're better off creating one monster table for this or spreading the load across several tables and doing a federated view sort of thing?

  • This depends on how many attributes they share.  Most of us, I think, tend to think of a table as modeling a "thing" in the real world.  We might, for example, use the same table for storing 'managers' and 'workers' if (say, from an HR perspective) they have a lot of the same attributes in common (e.g., first and last names, SSN, phone, address, etc.), and then employ another attribute to distinguish the role of the employee as manager or worker.  However, if the things you are modeling don't have enough in common, you'd have a lot of empty column values on some of the 'thing' types, and it would be sort of wasteful.  If, for example, you were storing makes of automobiles in the same table as makes of motor boats, it might get a little interesting.  What would a 4WD speedboat look like?  Or a Lincoln Continental with a Yamaha 200 HP 4-stroke outboard motor?

    Without knowing any particulars, my biases would incline me to prefer separate tables for separate things.

  • See this discussion

    One more thing to think about is can containers contain containers? 

    Another thing that I didn't mention in that discussion was the possiblity of a relationship existing between attributes or sub-sub-types.  The "flexible" name/value approach really falls on its face there.

    /*****************

    If most people are not willing to see the difficulty, this is mainly because, consciously or unconsciously, they assume that it will be they who will settle these questions for the others, and because they are convinced of their own capacity to do this. -Friedrich August von Hayek

    *****************/

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply