Re: random write in xlog?

From: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
To: flyusa2010 fly <flyusa2010(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: random write in xlog?
Date: 2010-12-08 16:27:11
Message-ID: AANLkTikzFFQoeovVRzA-AyozczNzmhTUKA6-pwcNgWCG@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Dec 7, 2010 at 2:06 PM, flyusa2010 fly <flyusa2010(at)gmail(dot)com> wrote:
> Hi, folks,
> I trace the running postgres, and I found that there are some randoms writes
> in xlog files!
> To my impression, log file writing is always sequential, how come random
> writes happen?
> Thanks in advance!

Just because it does an lseek doesn't mean it is "random".

Anyway, the writes are logically sequentially, but not physically. If
I remember correctly, it always writes out full blocks, even if the
last part of the block has not yet been filled with new data. When
the remainder gets filled, it then writes out the full block again,
both the already written and the new part.

Cheers,

Jeff

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kevin Grittner 2010-12-08 16:56:43 Re: serializable read only deferrable
Previous Message Oleg Bartunov 2010-12-08 16:13:08 Re: plperlu problem with utf8