Re: How many fields in a table are too many - Mailing list pgsql-general

From Mike Mascari
Subject Re: How many fields in a table are too many
Date
Msg-id 001101c33ba0$179d5960$0102a8c0@mascari.com
Whole thread Raw
In response to How many fields in a table are too many  (MT <m_tessier@sympatico.ca>)
Responses Re: How many fields in a table are too many  (Bruno Wolff III <bruno@wolff.to>)
List pgsql-general
> Hi,
>
> Just a quick question, not unrelated to my
> previous question, which I don't think will
> get answered. I have a table with 13 fields.
> Is that too many fields for one table.

Mathematically, a binary relation represents the relevant cross
product of two domains, x and f(x):

squares table:

 x  f(x)
--------
 0 | 0
 1 | 1
 2 | 4
 3 | 9
...

The relational model of data just leverages this along with
predicate logic to guarantee logical consistency and extends the
traditional view of a relation to n-dimensions. So, in your
relation (table), you should have a field which represents the
"x". The "x" should have a unique index associated with it.
After all, it wouldn't make sense in the above example to have
two records for "x". The other non-key fields should represent
the f(x), g(x), h(x). IOW, they should be dependent upon the
key, the whole key, and nothing but the key. If that is not the
case, you have some normalizing to do...

Hope that helps,

Mike Mascari
mascarm@mascari.com



pgsql-general by date:

Previous
From: "Maksim Likharev"
Date:
Subject: Re: Query plan question
Next
From: "Kallol Nandi"
Date:
Subject: Re: