Modelling items with attribute name/value pairs
Date: Fri, 23 Feb 2001 20:29:01 -0500
Message-ID: <3A970E5D.A44115B1_at_my-deja.com>
Hi everyone,
I am trying to model items in a database which have a varying number of properties. The idea would be to store item properties using attribute name/value pairs. Since it is not possible to know ahead of time how many properties an item will have, each property must be stored as a row in a table. Also, it is not possible to create a new property table for each item. As such, a table containing item properties would have to be shared by all items.
Thus, the table containing item properties, say "ItemProperties", would
look like this:
ItemID AttributeName AttributeValue
I have several concerns about such a design:
1 AttrName1 AttrValue1
1 AttrName2 AttrName2
1 AttrName3 AttrName3
2 AttrName1 AttrValue1
3 AttrName1 AttrValue1
3 AttrName2 AttrValue2
.. .. ..
- The properties of each item can be described by more than one row. (In
fact, the properties are likely to be described by several rows at the
very least). Thus, the ItemProperties table contains not one but several
rows for each item.
- In order to retrieve all the information associated with an item, all
- As the number of items in the database grows, the number of rows in
the ItemProperties table will grow to a much larger number.
Any comments or suggestions would be greatly appreciated.
Thanks,
Mark
herc7899_at_my-deja.com
Received on Sat Feb 24 2001 - 02:29:01 CET