run check constraints only when affected columns are changed?

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: run check constraints only when affected columns are changed?
Date: 2012-01-08 20:42:07
Message-ID: 1326055327.15293.13.camel@vanquo.pezone.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Currently, check constraints are verified whenever a table row is
updated at all. It seems to me that we could possibly make this quite a
bit more efficient if we only ran the check constraint expression when
the update changes a column that is referenced by the constraint
expression. Through dependency tracking, we have that information, and
we already have the catalog infrastructure to store this information
from primary and foreign keys. We'd just need to do some tweaking in
the executor. Any thoughts on that? Possible pitfalls?

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2012-01-08 20:48:12 psql tab completion for GRANT role
Previous Message Dimitri Fontaine 2012-01-08 20:36:28 Inline Extension