pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@commandprompt.com>
To: Greg Smith <gsmith@gregsmith.com>
Cc: Matthew Wakeling <matthew@flymine.org>
Cc: pgsql-performance@postgresql.org
Subject: Re: I/O on select count(*)
Date: Fri, 16 May 2008 17:00:50 -0400
Message-ID: <20080516210050.GL13061@alvh.no-ip.org> (raw)
In-Reply-To: <20080516201528.GJ13061@alvh.no-ip.org>
References: <920841.71690.qm@web44808.mail.sp1.yahoo.com>
	<482B1D5F.EE98.0025.0@wicourts.gov>
	<Pine.GSO.4.64.0805142133250.27290@westnet.com>
	<20080515020553.GN9838@alvh.no-ip.org>
	<Pine.LNX.4.64.0805151245360.16756@aragorn.flymine.org>
	<20080515155232.GC8221@alvh.no-ip.org>
	<Pine.GSO.4.64.0805161118210.4987@westnet.com>
	<20080516201528.GJ13061@alvh.no-ip.org>

Alvaro Herrera wrote:

> pg_clog is allocated in pages of 8kB apiece(*).  On allocation, pages are
> zeroed, which is the bit pattern for "transaction in progress".  So when
> a transaction starts, it only needs to ensure that the pg_clog page that
> corresponds to it is allocated, but it need not write anything to it.

Of course, in 8.3 it's not when the transaction starts, but when the Xid
is assigned (i.e. when the transaction first calls a read-write
command).  In previous versions it happens when the first snapshot is
taken (i.e. normally on the first command of any type, with very few
exceptions.)

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.



view thread (54+ messages)  latest in thread

Message-ID: <20080516210050.GL13061@alvh.no-ip.org>
Permalink:  ../20080516210050.GL13061@alvh.no-ip.org/
Also on:    postgresql.org/message-id/20080516210050.GL13061@alvh.no-ip.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-performance@postgresql.org
  Cc: alvherre@commandprompt.com, gsmith@gregsmith.com, matthew@flymine.org
  Subject: Re: I/O on select count(*)
  In-Reply-To: <20080516210050.GL13061@alvh.no-ip.org>
  References: <920841.71690.qm@web44808.mail.sp1.yahoo.com> <482B1D5F.EE98.0025.0@wicourts.gov> <Pine.GSO.4.64.0805142133250.27290@westnet.com> <20080515020553.GN9838@alvh.no-ip.org> <Pine.LNX.4.64.0805151245360.16756@aragorn.flymine.org> <20080515155232.GC8221@alvh.no-ip.org> <Pine.GSO.4.64.0805161118210.4987@westnet.com> <20080516201528.GJ13061@alvh.no-ip.org> <20080516210050.GL13061@alvh.no-ip.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox