Re: unlogged tables

From: "Pierre C" <lists(at)peufeu(dot)com>
To: "'Kevin Grittner'" <Kevin(dot)Grittner(at)wicourts(dot)gov>, "'Richard Huxton'" <dev(at)archonet(dot)com>, "'Sergey Konoplev'" <gray(dot)ru(at)gmail(dot)com>, "Anibal David Acosta" <aa(at)devshock(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org, "'Stephen Frost'" <sfrost(at)snowman(dot)net>
Subject: Re: unlogged tables
Date: 2011-12-04 12:28:03
Message-ID: op.v5ysw1d3eorkce@apollo13
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

> My table is a statistics counters table, so I can live with a partial
> data
> loss, but not with a full data loss because many counters are weekly and
> monthly.
>
> Unlogged table can increase speed, this table has about 1.6 millions of
> update per hour, but unlogged with a chance of loss all information on a
> crash are not a good idea for this.

You could use an unlogged table for hourly updates, and periodically,
accumulate those counters to a (logged) daily/weekly table...

The hourly table could be rebuilt by examining only 1 hour's worth of
data, so it isn't too much of a problem if it's lost. The other tables
would get much less updates.

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Thiago Godoi 2011-12-05 12:14:04 Re: Intersect/Union X AND/OR
Previous Message Bruce Momjian 2011-12-04 02:20:05 Re: pg_upgrade