Re: [GENERAL] [OT] "advanced" database design (long)

2008-02-09 Thread Christopher Browne
On Feb 3, 2008 11:14 PM, Alex Turner <[EMAIL PROTECTED]> wrote: > I"m not a database expert, but wouldn't > > create table attribute ( > attribute_id int > attribute text > ) > > create table value ( > value_id int > value text > ) > > create table attribute_value ( >entity_id int > a

Re: [GENERAL] [OT] "advanced" database design (long)

2008-02-09 Thread Patrick TJ McPhee
In article <[EMAIL PROTECTED]>, Alex Turner <[EMAIL PROTECTED]> wrote: % % I"m not a database expert, but wouldn't % % create table attribute ( % attribute_id int % attribute text % ) % % create table value ( % value_id int % value text % ) % % create table attribute_value ( % entity_

Re: [GENERAL] [OT] "advanced" database design (long)

2008-02-05 Thread Erik Jones
On Feb 5, 2008, at 10:17 AM, Alex Turner wrote: On Feb 4, 2008 7:09 AM, Scott Marlowe <[EMAIL PROTECTED]> wrote: On Feb 3, 2008 10:14 PM, Alex Turner <[EMAIL PROTECTED]> wrote: I"m not a database expert, but wouldn't create table attribute ( attribute_id int attribute text ) create tabl

Re: [GENERAL] [OT] "advanced" database design (long)

2008-02-05 Thread Alex Turner
I just thought of another problem, the system can have multiple values for a single attribute. How do you normalise that without basically adding a link table that's just the same thing as given below (I know there are array types in Postgresql, but there aren't in other DBs and I'm a fan of keepi

Re: [GENERAL] [OT] "advanced" database design (long)

2008-02-05 Thread Alex Turner
That is a very awesome system. I am constantly impressed at the awesomeness of Postgresql. Alex On Feb 4, 2008 1:06 PM, Tom Lane <[EMAIL PROTECTED]> wrote: > Jorge Godoy <[EMAIL PROTECTED]> writes: > > Em Monday 04 February 2008 07:03:47 Dawid Kuroczko escreveu: > >> Well, but PostgreSQL's NULLs

Re: [GENERAL] [OT] "advanced" database design (long)

2008-02-05 Thread Alex Turner
How do you normalize 90 arbitrary attributes away into subordinate tables? There will still be 90 of them, you can split them up into multiple tables, but it would just make joins a pain and potentially bog down the query planner I would think. Alex On Feb 4, 2008 7:09 AM, Scott Marlowe <[EMAIL P

Re: [GENERAL] [OT] "advanced" database design (long)

2008-02-04 Thread Tom Lane
Jorge Godoy <[EMAIL PROTECTED]> writes: > Em Monday 04 February 2008 07:03:47 Dawid Kuroczko escreveu: >> Well, but PostgreSQL's NULLs occupy almost no space, or rather a bit of >> space, that is one bit exactly. ;-) I am pretty much sure that >> storage-wise looking NULLs >> are more efficient.

Re: [GENERAL] [OT] "advanced" database design (long)

2008-02-04 Thread David Fetter
On Mon, Feb 04, 2008 at 10:49:51AM +0100, Masse Jacques wrote: > Hello [much garbage including HTML trimmed.] Please set your mail client to text-only. HTML does not make your point better, and it annoys the heck out of people whose mail readers use text. > This model is known as Entity-Value-A

Re: [GENERAL] [OT] "advanced" database design (long)

2008-02-04 Thread Gregory Stark
"Scott Marlowe" <[EMAIL PROTECTED]> writes: > On Feb 3, 2008 10:14 PM, Alex Turner <[EMAIL PROTECTED]> wrote: > >> give you a lot less pages to load than building a table with say 90 columns >> in it that are all null, which would result in better rather than worse >> performance? Fwiw Postgres

Re: [GENERAL] [OT] "advanced" database design (long)

2008-02-04 Thread Ivan Sergio Borgonovo
On Sat, 2 Feb 2008 09:45:57 -0800 David Fetter <[EMAIL PROTECTED]> wrote: > On Sat, Feb 02, 2008 at 01:38:19PM +0100, Thomas Pundt wrote: > > Hi, > > > > vladimir konrad wrote: > >> I think that I understand basic relational theory but > > Clearly, you'll have to revisit that thought. > > > [exa

Re: [GENERAL] [OT] "advanced" database design (long)

2008-02-04 Thread Scott Marlowe
On Feb 3, 2008 10:14 PM, Alex Turner <[EMAIL PROTECTED]> wrote: > I"m not a database expert, but wouldn't > > create table attribute ( > attribute_id int > attribute text > ) > > create table value ( > value_id int > value text > ) > > create table attribute_value ( >entity_id int > a

Re: [GENERAL] [OT] "advanced" database design (long)

2008-02-04 Thread Jorge Godoy
Em Monday 04 February 2008 07:03:47 Dawid Kuroczko escreveu: > On Feb 4, 2008 5:14 AM, Alex Turner <[EMAIL PROTECTED]> wrote: > > I"m not a database expert, but wouldn't > > [...] > > > give you a lot less pages to load than building a table with say 90 > > columns in it that are all null, which w

Re: [GENERAL] [OT] "advanced" database design (long)

2008-02-04 Thread Dawid Kuroczko
On Feb 4, 2008 5:14 AM, Alex Turner <[EMAIL PROTECTED]> wrote: > I"m not a database expert, but wouldn't > [...] > > give you a lot less pages to load than building a table with say 90 columns > in it that are all null, which would result in better rather than worse > performance? Well, but Postg

Re: [GENERAL] [OT] "advanced" database design (long)

2008-02-04 Thread Masse Jacques
] "advanced" database design (long) I"m not a database expert, but wouldn't create table attribute ( attribute_id int attribute text ) create table value ( value_id int

Re: [GENERAL] [OT] "advanced" database design (long)

2008-02-03 Thread Alex Turner
I"m not a database expert, but wouldn't create table attribute ( attribute_id int attribute text ) create table value ( value_id int value text ) create table attribute_value ( entity_id int attribute_id int value_id int ) give you a lot less pages to load than building a table w

Re: [GENERAL] [OT] "advanced" database design (long)

2008-02-03 Thread Shane Ambler
vladimir konrad wrote: Worst case would be another column flagging the test type. Why do you think this is the worst case? Bad choice of words - just referring to using the where clause to extract one particular test - if that is insufficient you can use a test column to track what test i

Re: [GENERAL] [OT] "advanced" database design (long)

2008-02-03 Thread vladimir konrad
Hello, and thanks > Are the tests that different that you need to segregate the data? > I see them both as being the time taken to travel a distance. The > only difference is whether the time or distance is used to end the > measurement. Good point (I have realised this after posting, when I dug

Re: [GENERAL] [OT] "advanced" database design (long)

2008-02-03 Thread Shane Ambler
vladimir konrad wrote: The system I am developing has to handle "tests" (for rowing athletes): 1. how many meters athlete did in 10 minutes (result is float) 2. how long it took the athlete to do 5 kilo-meters (the result is time) So it looks that I need table for each of 1 and 2 (because of di

Re: [GENERAL] [OT] "advanced" database design (long)

2008-02-03 Thread vladimir konrad
Hello, >> vladimir konrad wrote: >>> I think that I understand basic relational theory but > Clearly, you'll have to revisit that thought. Usually I have one table per "entity" modelled (and the table holds fields describing that entity). E.g. subject would have name fields and date of bir

Re: [GENERAL] [OT] "advanced" database design (long)

2008-02-02 Thread Karsten Hilbert
David Fetter wrote: > The math beneath this is that query complexity goes up like O(E!A!V!) > for Entity, Attribute and Value. Makes sense. > The first price, though, and by far the biggest, is that it's > impossible to maintain any kind of data integrity in such a system, as > such constraints,

Re: [GENERAL] [OT] "advanced" database design (long)

2008-02-02 Thread vladimir konrad
> If you have some part of your app that needs to "select" the list of > columns in a table you should look at > http://www.postgresql.org/docs/8.2/interactive/catalogs.html > particularly pg_class and pg_attribute Thanks, this could come handy. Vlad ---(end of broadcast

Re: [GENERAL] [OT] "advanced" database design (long)

2008-02-02 Thread Shane Ambler
Lewis Cunningham wrote: --- vladimir konrad <[EMAIL PROTECTED]> wrote: I think that I understand basic relational theory but then I had an idea. 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 t

Re: [GENERAL] [OT] "advanced" database design (long)

2008-02-02 Thread David Fetter
On Sat, Feb 02, 2008 at 01:38:19PM +0100, Thomas Pundt wrote: > Hi, > > vladimir konrad wrote: >> I think that I understand basic relational theory but Clearly, you'll have to revisit that thought. > [example stripped] > > Yes, this is known as eg. Entity-Attribute-Value model (cf. > wikipedia).

Re: [GENERAL] [OT] "advanced" database design (long)

2008-02-02 Thread vladimir konrad
> Basically, you would be creating your own data dictionary (i.e. > system catalog) on top of the db data dictionary. The database > already comes with a way to easily add columns: ddl. I have seen > newbie database designers reinvent this method a hundred times. The > performance hits and compl

Re: [GENERAL] [OT] "advanced" database design (long)

2008-02-02 Thread Bill Moran
vladimir konrad <[EMAIL PROTECTED]> wrote: > > Hello, > > 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 whe

Re: [GENERAL] [OT] "advanced" database design (long)

2008-02-02 Thread Lewis Cunningham
--- vladimir konrad <[EMAIL PROTECTED]> wrote: > I think that I understand basic relational theory but then I had an > idea. > 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 (li

Re: [GENERAL] [OT] "advanced" database design (long)

2008-02-02 Thread vladimir konrad
> Yes, this is known as eg. Entity-Attribute-Value model (cf. > wikipedia). Thank you for the pointer and term. This will get me started. > 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

Re: [GENERAL] [OT] "advanced" database design (long)

2008-02-02 Thread Thomas Pundt
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

[GENERAL] [OT] "advanced" database design (long)

2008-02-02 Thread vladimir konrad
Hello, 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 f