Re: Table with 90 columns - Mailing list pgsql-general

From Christoph Dalitz
Subject Re: Table with 90 columns
Date
Msg-id 20020916161544.569d6f88.christoph.dalitz@hs-niederrhein.de
Whole thread Raw
In response to Table with 90 columns  (Michael und Katrin Rudolph <MuK.Rudolph@t-online.de>)
List pgsql-general
>
> Ligia Pimentel schrieb:
> > Yes, a very wide table (many columns) will be less efficient than a table
> > with less columns (this is a matter of relational concepts and
> > normalization).
> >
I must admit that I do not understand this comment:
what has normalization to do with performance?

As far as I understand normalization it is meant to avoid *redundance* and
not to improve performance. Actually normalization in general decreases
performance becaus a join over several tables is much less efficient than a
select on a single table. In most (but not all!) cases it is more important
to avoid inconsistencies due to redundance however.

The only disadvantage of a table with many columns that I can imagine occurs
when the columns are addressed by name rather than by index. If postgres
implements the column lookup by a linear search through all column names,
this can become an issue in very wide tables.

Even in that case I do not know whether a breakup in n tables might increase
performance.

Christoph Dalitz

pgsql-general by date:

Previous
From: "Oliver Neumann"
Date:
Subject: STored Procedures
Next
From: Tom Lane
Date:
Subject: Re: mod_auth_pgsql