Re: Rules/Trigges Trade-offs

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Jean-Luc Lachance <jllachan(at)nsd(dot)ca>, pgsql-sql <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Rules/Trigges Trade-offs
Date: 2002-12-06 23:54:07
Message-ID: 200212061554.07415.josh@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-sql


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.

> > 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?

--
-Josh Berkus
Aglio Database Solutions
San Francisco

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Bruce Momjian 2002-12-07 02:24:44 Re: Rules/Trigges Trade-offs
Previous Message Bruce Momjian 2002-12-06 23:30:13 Re: Rules/Trigges Trade-offs

Browse pgsql-sql by date

  From Date Subject
Next Message Bruce Momjian 2002-12-07 02:24:44 Re: Rules/Trigges Trade-offs
Previous Message Bruce Momjian 2002-12-06 23:30:13 Re: Rules/Trigges Trade-offs