Re: Foreign key wierdness - Mailing list pgsql-hackers

From Didier Moens
Subject Re: Foreign key wierdness
Date
Msg-id 3E2F1AD7.8080101@xs4all.be
Whole thread Raw
In response to Re: Foreign key wierdness  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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




pgsql-hackers by date:

Previous
From: Antonio Scotti
Date:
Subject: On Commit Triggers
Next
From: Didier Moens
Date:
Subject: Re: Foreign key wierdness