index bloat problem

Started by Monika Cernikovaabout 19 years ago2 messagesgeneral
Jump to latest
#1Monika Cernikova
monika@microstep-mis.com

I use Postgres 8.1 on linux
I have several tables to which I need insert about 200-500 records per
minute.
Records contains timestamp (actual time), and this timestamp is part of
primary key and index.
I need to keep data for 1 month. I daily delete data older than 1 month
and than run vacuum analyze.
Size of primary keys and indexes still grows.
(After 2 months database size is about 35G and vacuum runs about 20 hours.
When I dumped and restored database, new size was 25G. Indexes and
constraints had half size)

Can you help me how to stop index growing or reindex database if I CAN'T
STOP writing records?

Thanx,

Monika

Here are my settings in postgresql.conf, that differs from defaults

shared_buffers = 2000

max_fsm_pages = 400000
(it isn't much, but there isn't logged in vacuum log that it needs more)

vacuum_cost_delay = 100
vacuum_cost_page_hit = 6
vacuum_cost_limit = 100

wal_buffers = 16
checkpoint_segments = 8

autovacuum = off

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Monika Cernikova (#1)
Re: [GENERAL] index bloat problem

Monika Cernikova <monika@microstep-mis.com> writes:

Can you help me how to stop index growing or reindex database if I CAN'T
STOP writing records?

I think you have max_fsm_pages set too small.

max_fsm_pages = 400000

That corresponds to about 3Gb, or a tenth the size of your DB. Not enough.

regards, tom lane