Re: Vacuum: allow usage of more than 1GB of work mem - Mailing list pgsql-hackers

From Greg Stark
Subject Re: Vacuum: allow usage of more than 1GB of work mem
Date
Msg-id CAM-w4HNcUmaez3sG7W+Xp9gZsCH5T7JFuhtSSi_-_A97VHv4ag@mail.gmail.com
Whole thread Raw
In response to Re: Vacuum: allow usage of more than 1GB of work mem  (Simon Riggs <simon@2ndquadrant.com>)
Responses Re: Vacuum: allow usage of more than 1GB of work mem  (Claudio Freire <klaussfreire@gmail.com>)
List pgsql-hackers
On Wed, Sep 7, 2016 at 1:45 PM, Simon Riggs <simon@2ndquadrant.com> wrote:
> On 6 September 2016 at 19:59, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
>> The idea of looking to the stats to *guess* about how many tuples are
>> removable doesn't seem bad at all.  But imagining that that's going to be
>> exact is folly of the first magnitude.
>
> Yes.  Bear in mind I had already referred to allowing +10% to be safe,
> so I think we agree that a reasonably accurate, yet imprecise
> calculation is possible in most cases.

That would all be well and good if it weren't trivial to do what
Robert suggested. This is just a large unsorted list that we need to
iterate throught. Just allocate chunks of a few megabytes and when
it's full allocate a new chunk and keep going. There's no need to get
tricky with estimates and resizing and whatever.

-- 
greg



pgsql-hackers by date:

Previous
From: Ildar Musin
Date:
Subject: Re: Index Onlys Scan for expressions
Next
From: Robert Haas
Date:
Subject: Re: Fun fact about autovacuum and orphan temp tables