Re: Re: [SQL] Rules with Conditions: Bug, or Misunderstanding

From: Mark Hollomon <mhh(at)mindspring(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Joel Burton" <jburton(at)scw(dot)org>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Re: [SQL] Rules with Conditions: Bug, or Misunderstanding
Date: 2000-12-02 02:47:51
Message-ID: 00120121475101.09339@jupiter.hollomon.fam
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-sql

On Friday 01 December 2000 00:33, Tom Lane wrote:
> The rewriting is done, all right, but what's left afterward still has
> references to the view, because each rule is conditional. Essentially,
> the rewriter output looks like
>
> -- rule 1
> if (rule1 condition holds)
> -- rule 2 applied to rule1 success case
> if (rule2 condition holds)
> apply rule 2's query
> else
> apply rule 1's query
> else
> -- rule 2 applied to rule1 failure case
> if (rule2 condition holds)
> apply rule 2's query
> else
> apply original query
>
> If the system were capable of determining that either rule1 or rule2
> condition will always hold, perhaps it could deduce that the original
> query on the view will never be applied. However, I doubt that we
> really want to let loose an automated theorem prover on the results
> of every rewrite ...

I think it would be better to move the test further down, to just before we
actually try to do the update/insert. Maybe into the heap access routines as
suggested by Andreas.

--
Mark Hollomon

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2000-12-02 05:11:23 Re: ALTER FUNCTION problem
Previous Message Mark Hollomon 2000-12-02 02:38:01 ALTER FUNCTION problem

Browse pgsql-sql by date

  From Date Subject
Next Message Ross J. Reedstrom 2000-12-02 03:27:06 Re: I can be a BUG?
Previous Message Edipo E. F. Melo 2000-12-01 23:48:44 I can be a BUG?