From: Jan Wieck <JanWieck@Yahoo.com>
To: Forest Wilkinson <fspam@home.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: ON UPDATE CASCADE overhead?
Date: Fri, 18 May 2001 09:37:00 -0400 (EDT)
Message-ID: <200105181337.JAA01649@jupiter.jw.home> (raw)
In-Reply-To: <01051717195200.04161@bartok>
Forest Wilkinson wrote:
> If I add ON UPDATE CASCADE to my foreign key definitions, how much will it
> affect performance for queries that don't trigger the cascade?
The trigger fired on the PK table does a check if the key
fields changed first. Therefore, at the first time of fireing
for this action during backend lifetime it'll do some
syscache lookups and remember the comparision functions to
call for this check. From then on it'll call the comparision
functions directly and return immediately without doing any
real work if the key effectively didn't change.
I expect it to not affect the performance significant. Would
be nice though if you'd run some tests and share the results
with us.
Jan
--
#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me. #
#================================================== JanWieck@Yahoo.com #
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: JanWieck@Yahoo.com, fspam@home.com
Subject: Re: ON UPDATE CASCADE overhead?
In-Reply-To: <200105181337.JAA01649@jupiter.jw.home>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox