Skip site navigation (1) Skip section navigation (2)

Re: How do FKs work?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Marc G(dot) Fournier" <scrappy(at)hub(dot)org>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: How do FKs work?
Date: 2004-10-10 00:23:53
Message-ID: 6093.1097367833@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-sql
"Marc G. Fournier" <scrappy(at)hub(dot)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

In response to

Responses

pgsql-sql by date

Next:From: Marc G. FournierDate: 2004-10-10 00:43:50
Subject: Re: How do FKs work?
Previous:From: Michael FuhrDate: 2004-10-09 21:59:51
Subject: Re: SQL confusion

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group