Re: Foreign key wierdness

From: Didier Moens <moensd(at)xs4all(dot)be>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Didier Moens <Didier(dot)Moens(at)dmb001(dot)rug(dot)ac(dot)be>, Dave Page <dpage(at)vale-housing(dot)co(dot)uk>, PostgreSQL Hackers Mailing List <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Foreign key wierdness
Date: 2003-01-22 22:27:35
Message-ID: 3E2F1AD7.8080101@xs4all.be
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Dear Tom, Dave,

Tom Lane wrote:

>Ah-hah, and I'll bet that the column being linked to this one by the
>foreign key constraint is still an integer?
>

It sure is ; being a PostgreSQL novice (BTW : many thanks to the whole
of the PG development team for such an excellent product), I got on this
track by means of
http://archives.postgresql.org/pgsql-sql/2001-05/msg00395.php .

>With two tables each containing some 20.000 entries, the fk creation
>time between both of them increases from ~ 1.8 secs to ~ 221 secs.
>
>
>
>Seems odd that the cost would get *that* much worse. Maybe we need to
>look at whether the FK checking queries need to include explicit casts
>...
>

Well, I reproduced the slowdown with some 20 to 30 different tables.
Anyway, glad I could be of some help, albeit only by testing some
(probably quite meaningless) border cases ... :)

Regards,
Didier

--

Didier Moens
-----
RUG/VIB - Dept. Molecular Biomedical Research - Core IT
tel ++32(9)2645309 fax ++32(9)2645348
http://www.dmb.rug.ac.be

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Didier Moens 2003-01-22 22:31:45 Re: Foreign key wierdness
Previous Message Dave Page 2003-01-22 22:04:05 Re: Foreign key wierdness