Re: Proposal: "query_work_mem" GUC, to distribute working memory to the query's individual operators

From: Saheed Ajiboye <ajiboyeca(at)gmail(dot)com>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Cc: 253330017(at)nileuniversity(dot)edu(dot)ng, manuelreyesbravo(at)gmail(dot)com
Subject: Re: Proposal: "query_work_mem" GUC, to distribute working memory to the query's individual operators
Date: 2026-12-06 14:41:08
Message-ID: CAGhdfNC-v3hJFoHfkgGE2s_qhZ2J+oDH65L2jSd053OT-RpU5Q@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Manu,

Thank you; that is very generous. The README and the bench scripts are
clear, and the calibration data is very useful.

I will cite the repository at commit 1937cc1 in my thesis and any papers,
and use it as a baseline at equal per-query budgets. As your README
describes, I plan to run it on REL_19_STABLE with your v2 patch, fixing the
nodeTableFuncscan.c hunk by hand.

Once again, thanks.

Saheed Ajiboye
PhD candidate, Department of Computer Science
Nile University of Nigeria

On Wed, Dec 2, 2026 at 10:19 PM Saheed Ajiboye <ajiboyeca(at)gmail(dot)com> wrote:

> Hi Manu,
>
> On Tue, Oct 6, 2026, you wrote:
> > I can share it if that is useful for judging whether the field earns its
> keep.
>
> I'd like to take you up on that. I'm a PhD student in Computer Science
> working on how to divide a fixed per-query working-memory budget among the
> Sort, Hash Join and Hash Aggregate nodes of a plan. The approach combines
> per-operator spill-cost models, the overlap of node memory lifetimes, and a
> probabilistic bound on exceeding the budget. Your per-node workmem field is
> exactly the enforcement hook this needs, and pg_mem_governor would be an
> important baseline.
>
> Could you share the pg_mem_governor source (a repository link or a tarball
> is fine), together with the spill-calibration scripts or data it uses, if
> those are separate? I would:
>
> - run it on your v2 patch against PostgreSQL 19 and compare it with other
> allocation policies at equal budgets on TPC-H and JOB;
> - credit and cite it in anything I publish; and
> - post any results that bear on the Plan.workmem field back to this thread.
>
> If there is a licence you'd like it used under, or you'd prefer I not
> redistribute it, just say so.
>
> In return I'm happy to test the patch more widely. I'm currently measuring
> when Sort, Hash and HashAggregate nodes actually release their memory
> during execution, and I'll share the results here.
>
> Thanks,
> Saheed Ajiboye
> PhD candidate, Department of Computer Science
> Nile University of Nigeria
>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Rui Zhao 2026-12-06 14:48:46 Add missing source files and gettext triggers to nls.mk
Previous Message Tomas Vondra 2026-12-06 14:24:24 BRIN minmax-multi summarize drops concurrently inserted values