Re: Newbie database design

From: Alex Petrov <master.db_at_mail.ru>
Date: Sun, 2 Jun 2002 01:05:42 +0000 (UTC)
Message-ID: <a68e4b86c6f62c3bcd376fc1c296bfec.54296_at_mygate.mailgate.org>


Hi,

> These are the 3 Datamodels I can think of...
> Do you know of other ones ?

(the format is: Table(Attr1, Attr2, ..AttrN, ..) PK - primary key, IE - inversion entry)

4) MessageTrace (Msg_id (PK), Attr_id (PK), Attr_value (IE))

where columns are:

Msg_id - message ID,
Attr_id - message attribute ID (number from 1 to N, where N - total number of attrs),
Attr_value - the value of message attribute

BENEFITS:
* no limit to number of message attributes, any number of attributes can be used,
* no Nullable columns/attributes, only acltually present attribute values are stored in column,
* no Join operations are needed, ie. to select a single attribute, say the 2nd one
for message with Id = 7, do

SELECT Msg_id, Attr_id as 'Attribute No.', Attr_value FROM MessageTrace WHERE Msg_id = 7 AND Attr_id = 2 ORDER BY Attr_id ASC

DRAWBACKS:
* no such obvious are visible to me :(

Hope this helps

Alex Petrov
Sys analyst,mcdba,ocp

~~~~~~~~~~~ ~~~~~~~~~~~ ~~~~~~~~~~~ ~~~~~~~~~~~ "SerGioGio" <serge.malonga_at_supelec.fr> wrote in message news:e42147c6.0205310818.5520f96_at_posting.google.com

> Hi !
>
> I need to store "Message Traces" in a RDMS. A "Message
> Trace" is a list of "Attributes" describing a "Message". Some
> "Attributes" can be optional.
> ...........

-- 
Posted via Mailgate.ORG Server - http://www.Mailgate.ORG
Received on Sun Jun 02 2002 - 03:05:42 CEST

Original text of this message