Re: Flattening a kind of 'dynamic' table

From: "Merlin Moncure" <merlin(dot)moncure(at)rcsonline(dot)com>
To: "Alexandre Leclerc" <alexandre(dot)leclerc(at)gmail(dot)com>
Cc: "PERFORM" <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Flattening a kind of 'dynamic' table
Date: 2005-01-27 21:05:09
Message-ID: 6EE64EF3AB31D5448D0007DD34EEB3412A75F4@Herge.rcsinc.local
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Andrew Sullivan 2005-01-27 21:36:59 Re: Swapping on Solaris
Previous Message Alexandre Leclerc 2005-01-27 20:02:48 Re: Flattening a kind of 'dynamic' table