pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: ashish@openskysoftware.com
Cc: pgsql-perform <pgsql-performance@postgresql.org>
Subject: Re: Foreign key constraints compile faster in 7.4
Date: Tue, 03 May 2005 11:59:47 -0400
Message-ID: <19631.1115135987@sss.pgh.pa.us> (raw)
In-Reply-To: <1115133083.3961.5.camel@skyserver1.openskysoftware.com>
References: <Pine.LNX.4.44.0505020858580.28631-100000@xenon.Stanford.EDU>
	<1115133083.3961.5.camel@skyserver1.openskysoftware.com>

Ashish Arte <ashish@openskysoftware.com> writes:
> We recently upgraded to Postgres 7.4 from 7.3.9 and noticed that the
> foreign key constraints compile noticeably faster. In 7.3 the
> constraints would typically take more than an hour to run on our
> production data. Now they take a minute or two.

> Can anybody explain such a major performance improvement ?

Hey, we do do some work on this thing from time to time ;-)

Probably you are talking about this:

2003-10-06 12:38  tgl

	* src/: backend/commands/tablecmds.c,
	backend/utils/adt/ri_triggers.c, include/commands/trigger.h: During
	ALTER TABLE ADD FOREIGN KEY, try to check the existing rows using a
	single LEFT JOIN query instead of firing the check trigger for each
	row individually.  Stephan Szabo, with some kibitzing from Tom Lane
	and Jan Wieck.


			regards, tom lane



view thread (2+ messages)

Message-ID: <19631.1115135987@sss.pgh.pa.us>
Permalink:  ../19631.1115135987@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/19631.1115135987@sss.pgh.pa.us

 · 

reply

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-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, ashish@openskysoftware.com
  Subject: Re: Foreign key constraints compile faster in 7.4
  In-Reply-To: <19631.1115135987@sss.pgh.pa.us>

* 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