Re: truncate a table instead of vaccum full when count(*) is 0 - Mailing list pgsql-performance

From ismo.tuononen@solenovo.fi
Subject Re: truncate a table instead of vaccum full when count(*) is 0
Date
Msg-id Pine.LNX.4.64.0705081249380.16350@ismoli.solenovo.jns
Whole thread Raw
In response to truncate a table instead of vaccum full when count(*) is 0  (Pomarede Nicolas <npomarede@corp.free.fr>)
List pgsql-performance

On Tue, 8 May 2007, Pomarede Nicolas wrote:

> As you can see, with hundreds of thousands events a day, this table will need
> being vaccumed regularly to avoid taking too much space (data and index).
>
> Note that processing rows is quite fast in fact, so at any time a count(*) on
> this table rarely exceeds 10-20 rows.
>
> For the indexes, a good way to bring them to a size corresponding to the
> actual count(*) is to run 'reindex'.

why you have index in table where is only 10-20 rows?

are those indexes to prevent some duplicate rows?

I have some tables just to store unprosessed data, and because there is
only few rows and I always process all rows there is no need for
indexes. there is just column named id, and when I insert row I take
nextval('id_seq') :

insert into some_tmp_table(id,'message',...) values (nextval('id_seq'),'do
something',...);

I know that deleting is slower than with indexes, but it's still fast
enough, because all rows are in memory.

and that id-column is just for delete, it's unique and i can always delete
using only it.

Ismo

pgsql-performance by date:

Previous
From: Pomarede Nicolas
Date:
Subject: Re: truncate a table instead of vaccum full when count(*) is 0
Next
From: david@lang.hm
Date:
Subject: Re: Best OS for Postgres 8.2