On Sun, 23 Oct 2005, Kishore B wrote:
> We need to insert into the bigger table almost for every second , through
> out the life time. In addition, we receive at least 200,000 records a day at
> a fixed time.
> We are facing a* critical situation because of the performance of the **
> database**.* Even a basic query like select count(*) from bigger_table is
> taking about 4 minutes to return.
Count(*) like that always scans the full table, but 4 minutes still sound
like a lot. How often do you vacuum? Could it be that the disk is full of
garbage due to not enough vacuum?
A query like this can help find bloat:
SELECT oid::regclass, reltuples, relpages FROM pg_class ORDER BY 3 DESC;
I assume to do updates and deletes as well, and not just inserts?
In response to
pgsql-performance by date
|Next:||From: Steinar H. Gunderson||Date: 2005-10-23 10:23:33|
|Subject: Re: Materializing a sequential scan|
|Previous:||From: Bruno Wolff III||Date: 2005-10-23 06:51:36|
|Subject: Re: prepared transactions that persist across sessions?|
pgsql-admin by date
|Next:||From: sualeh.fatehi||Date: 2005-10-23 16:06:23|
|Subject: Re: Monitoring database for changes - backup purposes|
|Previous:||From: Kishore B||Date: 2005-10-23 02:05:50|
|Subject: Re: Need help in setting optimal configuration for a huge database.|