Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id A98CC475C2B for ; Fri, 6 Dec 2002 18:50:50 -0500 (EST) Received: from davinci.ethosmedia.com (davinci.ethosmedia.com [209.10.40.250]) by postgresql.org (Postfix) with ESMTP id 134FA475B33 for ; Fri, 6 Dec 2002 18:50:50 -0500 (EST) Received: from [66.219.92.2] (HELO chocolate-mousse) by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.0.2) with ESMTP id 2270374; Fri, 06 Dec 2002 15:50:36 -0800 Content-Type: text/plain; charset="iso-8859-1" From: Josh Berkus Reply-To: josh@agliodbs.com Organization: Aglio Database Solutions To: Bruce Momjian Subject: Re: Rules/Trigges Trade-offs Date: Fri, 6 Dec 2002 15:54:07 -0800 X-Mailer: KMail [version 1.4] Cc: Jean-Luc Lachance , pgsql-sql References: <200212062330.gB6NUDl20018@candle.pha.pa.us> In-Reply-To: <200212062330.gB6NUDl20018@candle.pha.pa.us> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200212061554.07415.josh@agliodbs.com> X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200212/86 X-Sequence-Number: 10674 Bruce, > > 1) Rules can't use indexes to do their processing, so Rules which query= =20 large=20 > > secondary tables can be a bad idea (maybe this has changed?) >=20 > I don't think this is true. Rewrite is before optimizer so it should be > optimized just the same. I was speaking if the Rule has to do a lookup on a 2nd table in the course = of=20 its processing; it used to be that such a lookup could not use indexes=20 because Rules are pre-optimizer. This could have changed since 7.1, thoug= h. > > 3) There are no AFTER Rules, making, for example, a rule with a table= =20 check on=20 > > the new data impractical, so you'd want to use Triggers or Constraints >=20 > We have changed ordering in 7.3 where I think INSERT rules are _after_ > the insert. How would that work? What if I want to reject the insert? --=20 -Josh Berkus Aglio Database Solutions San Francisco