From: | Andrew Dunstan <andrew(at)dunslane(dot)net> |
---|---|
To: | Simon Riggs <simon(at)2ndQuadrant(dot)com> |
Cc: | Greg Stark <stark(at)mit(dot)edu>, Peter Geoghegan <peter(at)2ndquadrant(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: Deprecating RULES |
Date: | 2012-10-15 13:43:51 |
Message-ID: | 507C1317.9020200@dunslane.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On 10/15/2012 09:07 AM, Simon Riggs wrote:
> On 15 October 2012 11:41, Greg Stark <stark(at)mit(dot)edu> wrote:
>> On Mon, Oct 15, 2012 at 8:00 AM, Simon Riggs <simon(at)2ndquadrant(dot)com> wrote:
>>> Please can anyone show me the SQL for a rule that cannot be written as
>>> a view or a trigger? I do not believe such a thing exists and I will
>>> provide free beer to the first person that can prove me wrong.
>> Being written as a view doesn't help you because views use rules. I
>> repeat, the very fact that we need rules to implement views prove
>> rules are necessary for some purposes.
> No, it just means there is some aspect of similar underlying infrastructure.
>
> Denial of free beer looks like proof to me...
>
*sigh*
First, as Tom said, the onus of proof is on you. You can't transfer it
away with this offer of free beer.
Second, he's actually told you one advantage rules can have over
triggers, but you've pretty much chosen to ignore it:
> Triggers necessarily operate on a row-at-a-time basis. In theory,
> for at least some bulk operations, a rule could greatly outperform
> a trigger. It's difficult to walk away from that - unless somebody
> can prove that the advantage doesn't ever accrue in practice.
I have seen rules used instead of triggers for precisely this reason.
Yes, the fact that COPY bypasses rules is something you need to
remember, but that makes it a limitation of the feature, not an absolute
reason not to use it. (I rarely if ever use them myself - can't recall
the last time I did, but there is plenty of legacy use out there.)
cheers
andrew
From | Date | Subject | |
---|---|---|---|
Next Message | Amit kapila | 2012-10-15 13:58:52 | Re: patch submission: truncate trailing nulls from heap rows to reduce the size of the null bitmap [Review] |
Previous Message | Peter Geoghegan | 2012-10-15 13:14:34 | Re: Deprecating RULES |