Re: Very long deletion time on a 200 GB database - Mailing list pgsql-performance

From Lew
Subject Re: Very long deletion time on a 200 GB database
Date
Msg-id ji5mom$a0s$1@news.albasani.net
Whole thread Raw
In response to Re: Very long deletion time on a 200 GB database  ("ktm@rice.edu" <ktm@rice.edu>)
List pgsql-performance
On 02/23/2012 07:28 AM, ktm@rice.edu wrote:
> On Thu, Feb 23, 2012 at 05:25:46PM +0200, Reuven M. Lerner wrote:
>>>
>>> What is the distribution of end_dates? It might be worth running this in
>>> several steps, deleting records older than, say, 90 days, 60 days, 30 days.
>>
>> I've suggested something similar, but was told that we have limited
>> time to execute the DELETE, and that doing it in stages might not be
>> possible.
>
> In cases like this, I have often found that doing the delete in smaller
> pieces goes faster, sometimes much faster, than the bigger delete.

For some reason it is common for a conversation with a software manager to go
like this:

Programmer: Let's go with option "A"; it'll be much faster than what we're doing.
Manager: We don't have time to do that.

We don't have time to be faster? When I've had this conversation, the payback
was usually immediate, like it's Wednesday and it'll be faster by Thursday the
next day, and we'll get more done by Friday of the same week the new way. But
we don't have time.

I have had this conversation dozens of times over the years. (I was always
"Programmer".)

--
Lew
Honi soit qui mal y pense.
http://upload.wikimedia.org/wikipedia/commons/c/cf/Friz.jpg

pgsql-performance by date:

Previous
From: "Reuven M. Lerner"
Date:
Subject: Re: Very long deletion time on a 200 GB database
Next
From: Peter van Hardenberg
Date:
Subject: Re: set autovacuum=off