Greg Smith wrote:
> After reading the code and that documentation a bit, the part I'm still
> not sure about is whether the CLOG entry is created when the XID is
> assigned and then kept current as the state changes, or whether that
> isn't even in CLOG until the transaction is committed. It seems like the
> latter, but there's some ambiguity in the wording and too many code paths
> for me to map right now.
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.
(*) Each transaction needs 2 bits, so on a 8 kB page there is space for
4 transactions/byte * 8 pages * 1kB/page = 32k transactions.
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.
In response to
pgsql-performance by date
|Next:||From: Scott Marlowe||Date: 2008-05-16 20:35:24|
|Subject: Re: Regexps - never completing join.|
|Previous:||From: Craig Ringer||Date: 2008-05-16 19:25:17|
|Subject: Re: very slow left join|