Re: Size of Postgres Transaction Logs - Mailing list pgsql-general

From Tom Lane
Subject Re: Size of Postgres Transaction Logs
Date
Msg-id 20095.990204347@sss.pgh.pa.us
Whole thread Raw
In response to Size of Postgres Transaction Logs  (Vikaas BV <vikas@cellcloud.com>)
Responses Re: Size of Postgres Transaction Logs  (Lincoln Yeoh <lyeoh@pop.jaring.my>)
List pgsql-general
Vikaas BV <vikas@cellcloud.com> writes:
> I find that if there
> are repeated periodic operations on the postgres database, the
> transaction log size increases very rapidly (I was aghast to see that
> after initializing a new database with only 2 tables and a program
> polling one of the tables every 20 secs, the transaction log had grown
> to 120MB overnight) and there appears to be no mechanism of reducing the
> log size except for taking a dump, reinitializing the database and
> reimporting the dump.

The WAL log should be auto-truncated at checkpoints, assuming that the
old entries are no longer needed.  However, if you leave uncommitted
transactions sitting around, their WAL entries can't be deleted until
you commit or abort them.  I'd only expect massive WAL growth if you
have very long-running transactions ...

            regards, tom lane

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Re: Performance aggregates
Next
From: Justin Clift
Date:
Subject: Re: Which OS to Use for Postgresql