X-Original-To: pgsql-performance@postgresql.org Received: from localhost (developer.postgresql.org [64.117.224.193]) by developer.postgresql.org (Postfix) with ESMTP id 4CB7F921BBC for ; Fri, 30 May 2003 15:55:03 -0400 (EDT) Received: from developer.postgresql.org ([64.117.224.193]) by localhost (developer.postgresql.org [64.117.224.193:10024]) (amavisd-new) with ESMTP id 96780-10 for ; Fri, 30 May 2003 15:55:01 -0400 (EDT) Received: from davinci.ethosmedia.com (unknown [209.10.40.251]) by developer.postgresql.org (Postfix) with ESMTP id 67974921BC5 for ; Fri, 30 May 2003 15:55:01 -0400 (EDT) Received: from [66.219.92.2] (HELO temoku) by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.0.2) with ESMTP id 3079517; Fri, 30 May 2003 12:55:06 -0700 Content-Type: text/plain; charset="iso-8859-1" From: Josh Berkus Reply-To: josh@agliodbs.com Organization: Aglio Database Solutions To: Andrew Sullivan , pgsql-performance@postgresql.org Subject: Re: Table Relationships Date: Fri, 30 May 2003 12:54:26 -0700 User-Agent: KMail/1.4.3 References: <200305301003.19829.josh@agliodbs.com> <20030530181854.GA19077@libertyrms.info> In-Reply-To: <20030530181854.GA19077@libertyrms.info> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200305301254.26283.josh@agliodbs.com> X-Virus-Scanned: by amavisd-new X-Archive-Number: 200305/291 X-Sequence-Number: 2070 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=20 "materialized view" than denormalized data. The data is still stored in= =20 normal form; it is just distilled for a particular view and saved on disk f= or=20 quick reference. This is often a good approach with performance-sensitive,= =20 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= =20 your data in denormalized (basically flat file) form in the first place. --=20 -Josh Berkus Aglio Database Solutions San Francisco