Re: Flattening a kind of 'dynamic' table - Mailing list pgsql-performance

From Merlin Moncure
Subject Re: Flattening a kind of 'dynamic' table
Date
Msg-id 6EE64EF3AB31D5448D0007DD34EEB3412A75F4@Herge.rcsinc.local
Whole thread Raw
In response to Flattening a kind of 'dynamic' table  (Alexandre Leclerc <alexandre.leclerc@gmail.com>)
Responses Re: Flattening a kind of 'dynamic' table  (Alexandre Leclerc <alexandre.leclerc@gmail.com>)
List pgsql-performance
Alexandre wrote:
> > >
> > Right.  I expanding departments into columns is basically a dead
end.
> > First of all, SQL is not really designed to do this, and second of
all
> > (comments continued below)
>
> Ok, I got it. The basic message is to avoid making columns out of rows

yes.  This is wrong.

> like I'm doing right now, that "de-normalizing" in an array is the way
> to go.

Only sometimes.  Looping application code is another tactic.  There may
be other things to do as well that don't involve arrays or application
code.  Consider arrays a (very postgresql specific) tool in your
expanding toolchest.

De-normalization is a loaded term because we are only presenting queried
data in an alternate format (normalization normally applying to data
structured within the database).  There are many people on this list who
will tell you not to de-normalize anything, ever (and most of the time,
you shouldn't!).

Merlin

pgsql-performance by date:

Previous
From: Alexandre Leclerc
Date:
Subject: Re: Flattening a kind of 'dynamic' table
Next
From: Andrew Sullivan
Date:
Subject: Re: Swapping on Solaris