Re: VACUUM memory management

From: Ibrar Ahmed <ibrar(dot)ahmad(at)gmail(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: VACUUM memory management
Date: 2019-12-12 19:13:27
Message-ID: CALtqXTfaxwF9NxMeADfzeXPWsC+w3Vg0etCfHrRQ-Tqa=GXm2w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Dec 11, 2019 at 9:29 PM Ibrar Ahmed <ibrar(dot)ahmad(at)gmail(dot)com> wrote:

>
>
> On Wed, Dec 11, 2019 at 7:29 PM Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
>
>> On Mon, Dec 9, 2019 at 2:02 PM Ibrar Ahmed <ibrar(dot)ahmad(at)gmail(dot)com> wrote:
>> >> Did you see this thread?
>> >>
>> https://postgr.es/m/CAGTBQpbDCaR6vv9=scXzuT8fSbckf=a3NgZdWFWZbdVugVht6Q@mail.gmail.com
>> >>
>> > Yes, and somehow did what is explained.
>>
>> Did you modify Claudio's patch or write a totally new one?
>
>
> I wrote completely new patch. I tried multiple techniques like using a
> list instead of fixed size array which I thought was most suitable here,
> but leave that because of conflict with Parallel Vacuum.
>
>
>> In either case, why did you choose that approach?
>
>
> This is the simplest technique. I just divided the maintenance_work_mem in
> chunks and allocate chunks as needed. This technique change minimum code
> and do what we want to achieve.
>
>
>> If you wrote a totally new one, have you compared your work with
>> Claudio's, to see if he covered
>> anything you might need to cover?
>
>
> No, this part I missed, I will do that and will share my thoughts.
>
> I checked the patch, and it does not do anything special which my patch is
not doing except one thing. The patch is claiming to increase the limit of
1GB along with that, but I have not touched that. In my case, we are still
under the limit of maintaines_work_mem but allocate memory in chunks. In
that case, you have the leverage to set a big value of maintaness_work_mem
(even if you don't need that) because it will not allocate all the memory
at the start.

Secondly, the patch refactors the whole area of code which makes this patch
larger than expected. The code changes in the patch are almost doubled from
my patch. By the way, now I took the test cases from the patch and included
that into my patch (Credit Claudio)

Please explain why your patch is
>
>> better/different than his.
>>
>>
>
>> --
>> Robert Haas
>> EnterpriseDB: http://www.enterprisedb.com
>> The Enterprise PostgreSQL Company
>>
>
>
> --
> Ibrar Ahmed
>

--
Ibrar Ahmed

Attachment Content-Type Size
vacuum_dyn_mem_ibrar_v2.patch application/octet-stream 18.6 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David Fetter 2019-12-12 19:26:32 Re: Make autovacuum sort tables in descending order of xid_age
Previous Message Tom Lane 2019-12-12 19:01:49 force_parallel_mode = regress has a blind spot