Re: [COMMITTERS] pgsql: Add a WHEN clause to CREATE TRIGGER, allowing a boolean

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: [COMMITTERS] pgsql: Add a WHEN clause to CREATE TRIGGER, allowing a boolean
Date: 2009-11-20 22:05:02
Message-ID: 17969.1258754702@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> Random thought: would it be possible to use something like this to
> optimize foreign key constraints, by not firing them if none of the
> relevant columns have been updated?

There already is code in there to do that; see RI_FKey_keyequal_upd_fk
and RI_FKey_keyequal_upd_pk.

Earlier in the discussion of this patch I had suggested eliminating the
special-case code for FKs in favor of using a WHEN clause, but that
would probably not fly unless we can make the WHEN-based implementation
just as fast as the bespoke code; which seems unlikely.

regards, tom lane

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Robert Haas 2009-11-20 22:12:32 Re: [COMMITTERS] pgsql: Add a WHEN clause to CREATE TRIGGER, allowing a boolean
Previous Message Robert Haas 2009-11-20 22:00:05 Re: [COMMITTERS] pgsql: Add a WHEN clause to CREATE TRIGGER, allowing a boolean

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2009-11-20 22:12:32 Re: [COMMITTERS] pgsql: Add a WHEN clause to CREATE TRIGGER, allowing a boolean
Previous Message Robert Haas 2009-11-20 22:00:05 Re: [COMMITTERS] pgsql: Add a WHEN clause to CREATE TRIGGER, allowing a boolean