Re: Size of Postgres Transaction Logs

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Lincoln Yeoh <lyeoh(at)pop(dot)jaring(dot)my>
Cc: Vikaas BV <vikas(at)cellcloud(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Size of Postgres Transaction Logs
Date: 2001-05-19 03:37:51
Message-ID: 28419.990243471@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Lincoln Yeoh <lyeoh(at)pop(dot)jaring(dot)my> writes:
> So what happens typically is:
> 1) open DB connection.
> 2) wait for http request.
> 3) rollback (to implicitly begin a new transaction so that 'now' isn't
> years ago :) ).
> 4) do DB stuff
> 5) rollback/commit.

> Would we get massive WAL growth if the long running transactions are
> inactive (stuck at step 2) - not doing anything, but other transactions are
> active?

Not if they haven't done anything yet. "BEGIN" doesn't really start a
transaction, it's only your first database access that gets the
transaction engine running. Furthermore, if I recall the WAL stuff
correctly, what really counts for WAL is your first *write* access.
A read-only xact doesn't exist as far as WAL is concerned.

Nonetheless, I'm pretty concerned about this log-growth issue. See
current pghackers thread about whether we really need WAL to provide
UNDO support. AFAICS, we could truncate the WAL log at each checkpoint
if we didn't need UNDO.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tod McQuillin 2001-05-19 03:50:50 Re: PostgreSql and Caldera
Previous Message Lincoln Yeoh 2001-05-19 03:27:58 Re: Size of Postgres Transaction Logs