9.5: Better memory accounting, towards memory-bounded HashAgg

From: Jeff Davis <pgsql(at)j-davis(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: 9.5: Better memory accounting, towards memory-bounded HashAgg
Date: 2014-08-02 20:40:53
Message-ID: 1407012053.15301.53.camel@jeff-desktop
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Attached is a patch that explicitly tracks allocated memory (the blocks,
not the chunks) for each memory context, as well as its children.

This is a prerequisite for memory-bounded HashAgg, which I intend to
submit for the next CF. Hashjoin tracks the tuple sizes that it adds to
the hash table, which is a good estimate for Hashjoin. But I don't think
it's as easy for Hashagg, for which we need to track transition values,
etc. (also, for HashAgg, I expect that the overhead will be more
significant than for Hashjoin). If we track the space used by the memory
contexts directly, it's easier and more accurate.

I did some simple pgbench select-only tests, and I didn't see any TPS

Jeff Davis

Attachment Content-Type Size
memory-accounting.patch text/x-patch 6.1 KB


Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2014-08-02 22:58:14 Re: B-Tree support function number 3 (strxfrm() optimization)
Previous Message John Cochran 2014-08-02 18:43:20 Looked at TODO:Considering improving performance of computing CHAR() value lengths