Re: Speeding up DELETEs on table with FKs ...

From: "Marc G(dot) Fournier" <scrappy(at)postgresql(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Marc G(dot) Fournier" <scrappy(at)postgresql(dot)org>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Speeding up DELETEs on table with FKs ...
Date: 2004-10-11 06:39:10
Message-ID: 20041011033728.J54093@ganymede.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, 11 Oct 2004, Tom Lane wrote:

> "Marc G. Fournier" <scrappy(at)postgresql(dot)org> writes:
>> 'k, now that I've seen the error of my ways *groan* I've gone back
>> through, and checked for what is referencing that table, and there is only
>> one place that is, and it does have an INDEX:
>
>>> explain analyze select * from table where raw_id = 20722;
>> QUERY PLAN
>> -----------------------------------------------------------------------------------------------------------------------------------
>> Index Scan using ind_raw_id on table (cost=0.00..3.09 rows=1 width=122) (actual time=0.33..0.33 rows=0 loops=1)
>> Index Cond: (raw_id = 20722::numeric)
>> Total runtime: 0.37 msec
>
> "numeric", hm? Is the referenced column also of type numeric?

Correct, and a join of the two tables appears to use both indices, altho
one is of numeric(9,0) and the other numeric(12,0) ... could that
difference post a problem from a FK perspective that a SELECT/JOIN
wouldn't show?

----
Marc G. Fournier Hub.Org Networking Services (http://www.hub.org)
Email: scrappy(at)hub(dot)org Yahoo!: yscrappy ICQ: 7615664

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Stark 2004-10-11 06:50:18 Re: OT moving from MS SQL to PostgreSQL
Previous Message Andrew Dunstan 2004-10-11 06:10:36 Re: cvs tip broken build for plpython