Re: Sorting writes during checkpoint

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: ITAGAKI Takahiro <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>
Cc: Greg Smith <gsmith(at)gregsmith(dot)com>, pgsql-patches(at)postgresql(dot)org
Subject: Re: Sorting writes during checkpoint
Date: 2008-05-04 04:40:19
Message-ID: 4421.1209876019@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

ITAGAKI Takahiro <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp> writes:
> Greg Smith <gsmith(at)gregsmith(dot)com> wrote:
>> If shared_buffers(=NBuffers) is set to something big, this could give some
>> memory churn. And I think it's a bad idea to allocate something this
>> large at checkpoint time, because what happens if that fails? Really not
>> the time you want to discover there's no RAM left.

> Hmm, but I think we need to copy buffer tags into bgwriter's local memory
> in order to avoid locking taga many times in the sorting.

I updated this patch to permanently allocate the working array as Greg
suggests, and to fix a bunch of commenting issues (attached).

However, I am completely unable to measure any performance improvement
from it. Given the possible risk of out-of-memory failures, I think the
patch should not be applied without some direct proof of performance
benefits, and I don't see any.

regards, tom lane

Attachment Content-Type Size
unknown_filename text/plain 7.1 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Euler Taveira de Oliveira 2008-05-04 05:21:41 Re: Patch for Prevent pg_dump/pg_restore from being affected by statement_timeout
Previous Message Tom Lane 2008-05-04 00:55:31 Re: [HACKERS] Multiline privileges in \z

Browse pgsql-patches by date

  From Date Subject
Next Message Euler Taveira de Oliveira 2008-05-04 05:21:41 Re: Patch for Prevent pg_dump/pg_restore from being affected by statement_timeout
Previous Message Tom Lane 2008-05-04 00:55:31 Re: [HACKERS] Multiline privileges in \z