Skip site navigation (1) Skip section navigation (2)

Re: Table Relationships

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: Andrew Sullivan <andrew(at)libertyrms(dot)info>,pgsql-performance(at)postgresql(dot)org
Subject: Re: Table Relationships
Date: 2003-05-30 19:54:26
Message-ID: 200305301254.26283.josh@agliodbs.com (view raw or flat)
Thread:
Lists: pgsql-performance
Andrew,

> Sure, but if performance is an important goal for certain kinds of
> SELECTs, using a trigger at insert or update to do denormalising is
> perhaps an acceptable approach.  It's obvious that in most cases,
> denormalising instead of optimising your normalisation is silly.  But
> if you need something to return in, say, 2ms most of the time, and it
> requires a wide variety of data, denormalising is a good idea.

I've done this plenty of times ... but what you're talking about is more of a 
"materialized view" than denormalized data.   The data is still stored in 
normal form; it is just distilled for a particular view and saved on disk for 
quick reference.  This is often a good approach with performance-sensitive, 
complex databases.

> It is, of course, contrary to the RDBMS-y mind to denormalise.  But
> there are (rare) times when it's a good idea, and I hate to see it
> rejected out of hand in such cases.

There is a big difference between denormalizing normalized data and storing 
your data in denormalized (basically flat file) form in the first place.

-- 
-Josh Berkus
 Aglio Database Solutions
 San Francisco


In response to

pgsql-performance by date

Next:From: YusufDate: 2003-05-30 20:33:07
Subject: Enabling and Disabling Sequencial Scan
Previous:From: scott.marloweDate: 2003-05-30 19:33:19
Subject: Re: Hardware advice

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group