pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Marc G. Fournier <scrappy@hub.org>
Cc: pgsql-sql@postgresql.org
Subject: Re: How do FKs work?
Date: Sat, 09 Oct 2004 20:23:53 -0400
Message-ID: <6093.1097367833@sss.pgh.pa.us> (raw)
In-Reply-To: <20041009145332.D54093@ganymede.hub.org>
References: <20041009145332.D54093@ganymede.hub.org>

"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



view thread (7+ messages)  latest in thread

Message-ID: <6093.1097367833@sss.pgh.pa.us>
Permalink:  ../6093.1097367833@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/6093.1097367833@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, scrappy@hub.org
  Subject: Re: How do FKs work?
  In-Reply-To: <6093.1097367833@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox