From: | Michael Fuhr <mike(at)fuhr(dot)org> |
---|---|
To: | Öܵ½¾© <yourfriend(at)hf-sanyo(dot)com> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: question about "delete performance" |
Date: | 2005-01-24 05:22:10 |
Message-ID: | 20050124052210.GA39531@winnie.fuhr.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On Mon, Jan 24, 2005 at 12:29:12PM +0800, Öܵ½¾© wrote:
> I have a table with 500,000 records which has some invalid records,
> I had wrote a program to check it, by the program I get all OIDs of
> the redundant records, so I use "delete from tableXXX where oid =XXX1
> or oid =XXX2 or oid =XXX3 ... or oid=XXX1000, but it take me a long
> time to complete this action, then I change the query to " delete from
> tableXXX where oid in (XXX1,XXX2,XXX3,....X1000) ", but I got same
> result, does anyone can tell me the reason or postgresql has a bad
> performance in such situation.
What does EXPLAIN ANALYZE DELETE ... show? Do you have an index
on the oid column? Do you have foreign key constraints that need
to be checked when rows are deleted? Do you have rules or triggers
that are being invoked?
--
Michael Fuhr
http://www.fuhr.org/~mfuhr/
From | Date | Subject | |
---|---|---|---|
Next Message | Niederland | 2005-01-24 06:14:27 | Re: pg_restore |
Previous Message | Robert Creager | 2005-01-24 05:04:24 | Re: question about "delete performance" |