Re: pg_subtrans directory grows over 1 GB, is there a way to control it?

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: pg_subtrans directory grows over 1 GB, is there a way to control it?
Дата
Msg-id 20080516143939.GE13061@alvh.no-ip.org
обсуждение исходный текст
Ответ на pg_subtrans directory grows over 1 GB, is there a way to control it?  (Dennis Wang <dennis_02_2002@hotmail.com>)
Список pgsql-interfaces
Dennis Wang wrote:
> 
> I am using PostgreSQL database in a location recognition application, the files under postgresql/cluster is growing
andover a few days it become very large as below. 
 
>     /var/opt/postgresql/cluster/data  166015 Kilobytes  (the actual database data)
>     /var/opt/postgresql/cluster/sys/pg_clog 74188 Kilobytes  (transaction commit status data)
>     /var/opt/postgresql/cluster/sys/pg_subtrans   1187032 Kilobytes (transaction status data)
> 
> The pg_clog and pg_subtrans can grow when database contains more data and more queries come in. But these figures
looksrather large to me because the queries goes in the database are mainly read operation rather than write one. I got
afew question to ask here:
 
>      Is there a way to control the size of pg_clog and pg_subtrans? 
>      Is the file size still be normal for the database of this size (166MB for cluster/data)?
>      Does the larger pg_subtrans indicate some bad transaction happens in the database?

I think it can be an indication that you're leaving transactions running
for too long.  Check pg_stat_activity, and if you see "<IDLE> in
transaction", start worrying about that.

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


В списке pgsql-interfaces по дате отправления:

Предыдущее
От: Dennis Wang
Дата:
Сообщение: pg_subtrans directory grows over 1 GB, is there a way to control it?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: pg_subtrans directory grows over 1 GB, is there a way to control it?