Re: [COMMITTERS] pgsql: Reduce the size of memoryallocations by lazy vacuum when

From: Gregory Stark <stark(at)enterprisedb(dot)com>
To: "Heikki Linnakangas" <heikki(at)enterprisedb(dot)com>
Cc: "Simon Riggs" <simon(at)2ndquadrant(dot)com>, "Alvaro Herrera" <alvherre(at)postgresql(dot)org>, "PostgreSQL-development" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [COMMITTERS] pgsql: Reduce the size of memoryallocations by lazy vacuum when
Date: 2007-09-24 11:48:01
Message-ID: 87myvcffny.fsf@oxford.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

"Heikki Linnakangas" <heikki(at)enterprisedb(dot)com> writes:

> Simon Riggs wrote:
>> On Mon, 2007-09-24 at 10:02 +0100, Heikki Linnakangas wrote:
>>> How about just using MaxHeapTuplesPerPage? With the default 8K block
>>> size, it's not that much more than 200, but makes the above gripes
>>> completely go away. That seems like the safest option at this point.
>>
>> It would be much better to use a value for each table. Any constant
>> value will be sub-optimal in many cases.
>
> Allocating extra memory doesn't usually do much harm, as long as you
> don't actually use it. The reason we're now limiting it is to avoid Out
> Of Memory errors if you're running with overcommit turned off, and
> autovacuum triggers a vacuum on multiple tables at the same time.

For reference, MaxHeapTuplesPerPage on an 8k block is 291. If there are any
columns in your tuples (meaning they're not either HOT updates which have been
pruned or rows with 8 or fewer columns all of which are null) then the most
you can have is 255 rows.

For the small difference between 200 and 291 it seems safer to just use
MaxHeapTuplesPerPage.

BS MHTPG Max w/data
--------------------------
4096 145 127
8192 291 255
16384 584 511
32768 1169 1023

--
Gregory Stark
EnterpriseDB http://www.enterprisedb.com

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Andrew Dunstan 2007-09-24 11:54:52 Re: pgsql: Add perl replacements for build.bat and vcregress.bat.
Previous Message Heikki Linnakangas 2007-09-24 10:34:23 Re: [COMMITTERS] pgsql: Reduce the size ofmemoryallocations by lazy vacuum when

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2007-09-24 11:49:59 Re: Bytea as C string in pg_convert?
Previous Message Peter Eisentraut 2007-09-24 10:51:30 Re: GUC variable renaming, redux