Re: Theory question

From: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
To: Jayadevan <maymala(dot)jayadevan(at)gmail(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Theory question
Date: 2013-11-13 16:46:41
Message-ID: CAMkU=1zuo=1MFtpTsD52f2TqBVAkzWnfH5JcU7MhVv0pLr7U1g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Nov 12, 2013 at 7:09 PM, Jayadevan <maymala(dot)jayadevan(at)gmail(dot)com>wrote:

> Kevin Grittner-5 wrote
> > The checkpointer process is responsible for creating safe points
> > from which a recovery can begin; the background writer tries to
> > keep some pages available for re-use so that processes running
> > queries don't need to wait for page writes in order to have free
> > spots to use in shared buffers.
>
> Thank you. Do both of them write to the same files?

Yes, mostly. (The checkpointer also does some other housekeeping writes
beyond the ordinary data file ones)

> Is it that checkpoint
> writes only committed data whereas background writer may also write
> non-committed data if there is no space available in the buffers?
>

No. The checkpointer writes all data that was dirty as of a certain time
(the start of the checkpoint) regardless of how often it was used since
dirtied, and the background writer writes data that hasn't been used
recently, regardless of when it was first dirtied. Neither knows or cares
whether the data being written was committed, rolled back, or still in
progress.

Cheers,

Jeff

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Janek Sendrowski 2013-11-13 17:37:50 pg_trgm module: no convertion into Trigrams on one side when comparing
Previous Message Alban Hertroys 2013-11-13 16:25:13 Re: Pg version number format