From: | Thomas Pundt <mlists(at)rp-online(dot)de> |
---|---|
To: | vladimir konrad <vk(at)dsl(dot)pipex(dot)com> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: [OT] "advanced" database design (long) |
Date: | 2008-02-02 12:38:19 |
Message-ID: | 47A4643B.70608@rp-online.de |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Hi,
vladimir konrad wrote:
> I think that I understand basic relational theory but then I had an
> idea. What I would like to know if this is sometimes done or that I am
> possibly mad... Also, I do not know the terminology for this kind of
> thing so I do not know where and what to look for.
>
> Basically, instead of adding field to a table every time there is a
> need for it, have a table split in two: one holds identity (id) and one
> holds the attributes (linked to this id). For example, modelling
> subject (person):
[example stripped]
> The advantage I see, is that to add new fields (here "attributes") no
> db development would be needed and user could do this.
>
> The disadvantages I see is that the model is hard to work with (i.e. how
> do I see subject (with attributes) as a table - could cross join be
> used for this?. Also, hand writing the queries for this would be hard
> (possibly needed if user would like to write custom reports).
>
> Do people do this kind of thing (or I took it too far)? If yes, I would
> be grateful for pointers to examples or any other info on this...
Yes, this is known as eg. Entity-Attribute-Value model (cf. wikipedia).
IMO most times its disadvantages (it can be very hard to write
performant queries compared to the traditional row based model) weigh
higher than you gain (in flexibility) in relational databases. But it
sure has its uses cases.
Ciao,
Thomas
From | Date | Subject | |
---|---|---|---|
Next Message | damien clochard | 2008-02-02 12:56:27 | Re: PostgreSQL Certification |
Previous Message | vladimir konrad | 2008-02-02 12:02:29 | [OT] "advanced" database design (long) |