pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Josh Berkus <josh@agliodbs.com>
To: Andrew Sullivan <andrew@libertyrms.info>
To: pgsql-performance@postgresql.org
Subject: Re: Table Relationships
Date: Fri, 30 May 2003 12:54:26 -0700
Message-ID: <200305301254.26283.josh@agliodbs.com> (raw)
In-Reply-To: <20030530181854.GA19077@libertyrms.info>
References: <200305301003.19829.josh@agliodbs.com>
	<Pine.LNX.4.33.0305301118070.31612-100000@css120.ihs.com>
	<20030530181854.GA19077@libertyrms.info>

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




view thread (12+ messages)  latest in thread

Message-ID: <200305301254.26283.josh@agliodbs.com>
Permalink:  ../200305301254.26283.josh@agliodbs.com/
Also on:    postgresql.org/message-id/200305301254.26283.josh@agliodbs.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-performance@postgresql.org
  Cc: josh@agliodbs.com, andrew@libertyrms.info
  Subject: Re: Table Relationships
  In-Reply-To: <200305301254.26283.josh@agliodbs.com>
  References: <200305301003.19829.josh@agliodbs.com> <Pine.LNX.4.33.0305301118070.31612-100000@css120.ihs.com> <20030530181854.GA19077@libertyrms.info> <200305301254.26283.josh@agliodbs.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox