Re: Move unused buffers to freelist

From: Amit kapila <amit(dot)kapila(at)huawei(dot)com>
To: Jim Nasby <jim(at)nasby(dot)net>
Cc: "'PostgreSQL-development'" <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: Move unused buffers to freelist
Date: 2013-05-25 06:32:50
Message-ID: 6C0B27F7206C9E4CA54AE035729E9C38421B24BF@szxeml558-mbs.china.huawei.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Friday, May 24, 2013 8:22 PM Jim Nasby wrote:
On 5/14/13 8:42 AM, Amit Kapila wrote:
>> In the attached patch, bgwriter/checkpointer moves unused (usage_count =0 && refcount = 0) buffer’s to end of freelist. I have implemented a new API StrategyMoveBufferToFreeListEnd() to
>>
>> move buffer’s to end of freelist.
>>

> Instead of a separate function, would it be better to add an argument to StrategyFreeBuffer?

Yes, it could be done with a parameter which will decide whether to put buffer at head or tail in freelist.
However currently the main focus is to check in which cases this optimization can give benefit.
Robert had ran tests for quite a number of cases where it doesn't show any significant gain.
I am also trying with various configurations to see if it gives any benefit.
Robert has given some suggestions to change the way currently new function is getting called,
I will try it and update the results of same.

I am not very sure that default pgbench is a good test scenario to test this optimization.
If you have any suggestions for tests where it can show benefit, that would be a great input.

> ISTM this is similar to the other strategy stuff in the buffer manager, so perhaps it should mirror that...

With Regards,
Amit Kapila.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit kapila 2013-05-25 07:05:10 Re: pg_rewind, a tool for resynchronizing an old master after failover
Previous Message Hannu Krosing 2013-05-25 06:23:15 Re: getting rid of freezing