From: | ismo(dot)tuononen(at)solenovo(dot)fi |
---|---|
To: | Pomarede Nicolas <npomarede(at)corp(dot)free(dot)fr> |
Cc: | pgsql-performance(at)postgresql(dot)org |
Subject: | Re: truncate a table instead of vaccum full when count(*) is 0 |
Date: | 2007-05-08 10:00:00 |
Message-ID: | Pine.LNX.4.64.0705081249380.16350@ismoli.solenovo.jns |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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
From | Date | Subject | |
---|---|---|---|
Next Message | Guillaume Cottenceau | 2007-05-08 10:02:39 | Re: truncate a table instead of vaccum full when count(*) is 0 |
Previous Message | Steinar H. Gunderson | 2007-05-08 09:48:06 | Re: Best OS for Postgres 8.2 |