Re: left join with smaller table or index on (XXX is not null) to avoid upsert - Mailing list pgsql-general

From Tom Lane
Subject Re: left join with smaller table or index on (XXX is not null) to avoid upsert
Date
Msg-id 6929.1232383419@sss.pgh.pa.us
Whole thread Raw
In response to Re: left join with smaller table or index on (XXX is not null) to avoid upsert  ("Scott Marlowe" <scott.marlowe@gmail.com>)
Responses Re: left join with smaller table or index on (XXX is not null) to avoid upsert  (Grzegorz Jaśkiewicz <gryzman@gmail.com>)
Re: left join with smaller table or index on (XXX is not null) to avoid upsert  (Dimitri Fontaine <dfontaine@hi-media.com>)
List pgsql-general
"Scott Marlowe" <scott.marlowe@gmail.com> writes:
> But seriously, it's doing what you told it to do. There might be
> corner cases where you need a trigger to fire for a row on change, and
> short-circuiting could cause things to fail in unexpected ways.

The other argument against doing this by default is that with
non-stupidly-written applications, the cycles expended to check for
vacuous updates would invariably be wasted.  Even if the case did
come up occasionally, it's not hard at all to foresee that the extra
checking could be a net loss overall.

But having said that: 8.4 will provide a standard trigger that
short-circuits vacuous updates, which you can apply to tables in which
you think vacuous updates are likely.  It's your responsibility to place
the trigger so that it doesn't interfere with any other trigger
processing you may have.

            regards, tom lane

pgsql-general by date:

Previous
From: Ivan Sergio Borgonovo
Date:
Subject: Re: How can I look at a recursive table dependency tree?
Next
From: Grzegorz Jaśkiewicz
Date:
Subject: Re: left join with smaller table or index on (XXX is not null) to avoid upsert