pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
ON UPDATE CASCADE overhead?
2+ messages / 2 participants
[nested] [flat]

* ON UPDATE CASCADE overhead?
@ 2001-05-18 00:19 Forest Wilkinson <fspam@home.com>
  2001-05-18 13:37 ` Re: ON UPDATE CASCADE overhead? Jan Wieck <JanWieck@Yahoo.com>
  0 siblings, 1 reply; 2+ messages in thread

From: Forest Wilkinson @ 2001-05-18 00:19 UTC (permalink / raw)
  To: pgsql-sql

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?

Cheers,

Forest



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: ON UPDATE CASCADE overhead?
  2001-05-18 00:19 ON UPDATE CASCADE overhead? Forest Wilkinson <fspam@home.com>
@ 2001-05-18 13:37 ` Jan Wieck <JanWieck@Yahoo.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Jan Wieck @ 2001-05-18 13:37 UTC (permalink / raw)
  To: Forest Wilkinson <fspam@home.com>; +Cc: pgsql-sql

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




^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2001-05-18 13:37 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-05-18 00:19 ON UPDATE CASCADE overhead? Forest Wilkinson <fspam@home.com>
2001-05-18 13:37 ` Jan Wieck <JanWieck@Yahoo.com>

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