Re: Fast Deletion For Large Tables - Mailing list pgsql-admin

From Hubert depesz Lubaczewski
Subject Re: Fast Deletion For Large Tables
Date
Msg-id 20021005082136.GA23998@depesz.pl
Whole thread Raw
In response to Fast Deletion For Large Tables  (Raymond Chui <raymond.chui@noaa.gov>)
List pgsql-admin
On Wed, Oct 02, 2002 at 02:20:39PM -0400, Raymond Chui wrote:
> Everything is running fine, except take long time to finish.
> Because some tables stored values from 50,000 to 100,000 rows
> Some deletion need to deleted up to 45,000 rows.

how often do you make this "delete" process?
do you vacuum before *and* after it?
with deleteing 45000 out of 50000 (or 100000) records no index can speed
up. anyway - deleting 45000 records shouldn't take very long.
do you have any foreign keys from this table to others? any indices?

try maybe this path:
connect
vacuum
drop indices
disconnect
connect
delete from ...
create indices
vacuum analyze
disconnect

could work better.

depesz

--
hubert depesz lubaczewski                          http://www.depesz.pl/
------------------------------------------------------------------------
Mój Boże, spraw abym milczał, dopóki się nie upewnię,  że  naprawdę  mam
coś do powiedzenia.                                      (c) 1998 depesz


Attachment

pgsql-admin by date:

Previous
From: CoL
Date:
Subject: Re: Replication, High availability
Next
From: "Devinder K Rajput"
Date:
Subject: Query takes too long to run