batch write of dirty buffers

From: "Qingqing Zhou" <zhouqq(at)cs(dot)toronto(dot)edu>
To: pgsql-hackers(at)postgresql(dot)org
Subject: batch write of dirty buffers
Date: 2004-06-14 03:20:31
Message-ID: caj5k4$17mb$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

In checkpoint and background writer, we flush out dirty buffer pages one
page one time. Is it possible to do in a batch mode? That is, try to find
out the continous page(same tblNode, relNode, adjacent blockNum), then write
them together?
To find out continous pages, most cases can be handled by just a qsort() of
candidate dirty pages, exceptional conditions may include the segment
boundary check if we don't let OS manage file size. This change will reduce
the write times, esp. if the database is in a batch update mode. We except
to write hundreds of pages by issuing just one smgrwrite().

There are other two points may need attentions. One is in function
StartBufferIO(), which asserts InProgressBuf, that is, we can just do one
page write one time. I am not quite sure the consequence if we remove this
variable. The other is that since we will acquire many locks on the buffer
page, so we may have to increase MAX_SIMUL_LWLOCKS. This should not be a
problem.

What's your ideas?

Regards,

Qingqing
http://www.cs.toronto.edu/~zhouqq

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Joshua D. Drake 2004-06-14 03:50:40 Re: I just got it: PostgreSQL Application Server -- a
Previous Message Christopher Kings-Lynne 2004-06-14 03:10:15 Other bit oddities