Re: How to avoid transaction ID wrap - Mailing list pgsql-hackers

From Martijn van Oosterhout
Subject Re: How to avoid transaction ID wrap
Date
Msg-id 20060610161102.GA10174@svana.org
Whole thread Raw
In response to Re: How to avoid transaction ID wrap  (Trent Shipley <tshipley@deru.com>)
Responses Re: How to avoid transaction ID wrap  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Fri, Jun 09, 2006 at 06:20:21PM -0700, Trent Shipley wrote:
> VACCUM needs to be run for two reasons.
> 1) To recover the transaction counter.
> 2) To recover records marked for deletion.
>
> VACCUM needs to be run over the entire database.  If the data in the database
> is N, then VACCUM is O(N).  Roughly, VACCUM scales linearly with the size of
> the database.

Well, you only need to vacuum the entire database once every billion
transactions.

Secondly, you can vacuum table by table. If you know a table will never
be modified, you can VACUUM FREZZE it, then it will never need to be
vacuumed again, ever (until you make changes ofcourse).

> Ideally, the transaction management system would be proportional to the
> marginal change in size of the database rather than the gross size of the
> database.  That is VACCUM being O(N) should be replaced (or there should be
> an optional alternative) that scales with D, O^k(D) where any k > 1 involves
> a tradeoff with VACCUM.

That's why people suggest partitions. Then you only vacuum the
partitions that are new and the old ones never need to be touched...

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

pgsql-hackers by date:

Previous
From: "Ian Caulfield"
Date:
Subject: Re: Ranges for well-ordered types
Next
From: Tom Lane
Date:
Subject: Re: Ranges for well-ordered types