Re: Foreign key constraints compile faster in 7.4 - Mailing list pgsql-performance

From Tom Lane
Subject Re: Foreign key constraints compile faster in 7.4
Date
Msg-id 19631.1115135987@sss.pgh.pa.us
Whole thread Raw
In response to Foreign key constraints compile faster in 7.4  (Ashish Arte <ashish@openskysoftware.com>)
List pgsql-performance
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

pgsql-performance by date:

Previous
From: Kris Jurka
Date:
Subject: Re: batch inserts are "slow"
Next
From: Tom Lane
Date:
Subject: Re: