pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruce Momjian <pgman@candle.pha.pa.us>
To: josh@agliodbs.com
Cc: Jean-Luc Lachance <jllachan@nsd.ca>
Cc: pgsql-sql <pgsql-sql@postgresql.org>
Subject: Re: Rules/Trigges Trade-offs
Date: Fri, 6 Dec 2002 21:24:44 -0500 (EST)
Message-ID: <200212070224.gB72OiM06066@candle.pha.pa.us> (raw)
In-Reply-To: <200212061554.07415.josh@agliodbs.com>

Josh Berkus wrote:
> 
> Bruce,
> 
> > > 1) Rules can't use indexes to do their processing, so Rules which query 
> large 
> > > secondary tables can be a bad idea (maybe this has changed?)
> > 
> > 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 
> its processing; it used to be that such a lookup could not use indexes 
> because Rules are pre-optimizer.   This could have changed since 7.1, though.

As I remember, the RULE is processed just like an ordinary query.  I
wasn't aware it was looking up anything.

> > > 3) There are no AFTER Rules, making, for example, a rule with a table 
> check on 
> > > the new data impractical, so you'd want to use Triggers or Constraints
> > 
> > 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?

Uh, good question.  I can't remember now what we re-ordered in 7.3, but
I thought it had to do with rules.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073



view thread (14+ messages)  latest in thread

Message-ID: <200212070224.gB72OiM06066@candle.pha.pa.us>
Permalink:  ../200212070224.gB72OiM06066@candle.pha.pa.us/
Also on:    postgresql.org/message-id/200212070224.gB72OiM06066@candle.pha.pa.us

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: pgman@candle.pha.pa.us, josh@agliodbs.com, jllachan@nsd.ca
  Subject: Re: Rules/Trigges Trade-offs
  In-Reply-To: <200212070224.gB72OiM06066@candle.pha.pa.us>

* 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