Re: On query rewrite - Mailing list pgsql-hackers

From Bruno Wolff III
Subject Re: On query rewrite
Date
Msg-id 20040528162345.GA31689@wolff.to
Whole thread Raw
In response to Re: On query rewrite  (Sailesh Krishnamurthy <sailesh@cs.berkeley.edu>)
List pgsql-hackers
On Thu, May 27, 2004 at 19:35:56 -0700, Sailesh Krishnamurthy <sailesh@cs.berkeley.edu> wrote:
> 
> Another question about regular RULE processing .. suppose after
> applying a rule the resultant query tree is eligible for another rule,
> does pgsql's rule system keep iterating over and over until it reaches
> a fixed point or is there some heuristic in operation (just apply the
> rules twice ..) ? From my cursory inspection of the code it looks like
> the latter, but I'd like to know for sure. 

Rule processing continues as long as there are rules to apply or the
query is terminated.

You might want to read up on rules in the documentation. They are the
mechanism used to make updateable views and can do some other interesting
things. And because they are fully visible to the optimizer (unlike
triggers) they don't prevent optimization.


pgsql-hackers by date:

Previous
From: "Matthew T. O'Connor"
Date:
Subject: Re: Win32, PITR, nested transactions, tablespaces
Next
From: Bruce Momjian
Date:
Subject: Re: yet another contrib module