Re: How do FKs work? - Mailing list pgsql-sql

From Tom Lane
Subject Re: How do FKs work?
Date
Msg-id 6093.1097367833@sss.pgh.pa.us
Whole thread Raw
In response to How do FKs work?  ("Marc G. Fournier" <scrappy@hub.org>)
Responses Re: How do FKs work?
Re: How do FKs work?
List pgsql-sql
"Marc G. Fournier" <scrappy@hub.org> writes:
> Have a table with two FKs on it ... 2 different fields in the table point 
> to the same field in another table ...

> When I do an 'EXPLAIN ANALYZE DELETE FROM table WHERE field = #;', it 
> never comes back ... or, at lesat, takes a *very* long time ...

Do you have indexes on the referencing columns?  Are they exactly the
same datatype as the referenced column?  You can get really awful plans
for the FK-checking queries if not.
        regards, tom lane


pgsql-sql by date:

Previous
From: "Marc G. Fournier"
Date:
Subject: How do FKs work?
Next
From: "Marc G. Fournier"
Date:
Subject: Re: How do FKs work?