Re: random write in xlog? - Mailing list pgsql-hackers

From Jeff Janes
Subject Re: random write in xlog?
Date
Msg-id AANLkTikzFFQoeovVRzA-AyozczNzmhTUKA6-pwcNgWCG@mail.gmail.com
Whole thread Raw
In response to random write in xlog?  (flyusa2010 fly <flyusa2010@gmail.com>)
Responses XLog vs SSD [Was: Re: random write in xlog?]  (James Cloos <cloos@jhcloos.com>)
List pgsql-hackers
On Tue, Dec 7, 2010 at 2:06 PM, flyusa2010 fly <flyusa2010@gmail.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


pgsql-hackers by date:

Previous
From: Oleg Bartunov
Date:
Subject: Re: plperlu problem with utf8
Next
From: "Kevin Grittner"
Date:
Subject: Re: serializable read only deferrable