Re: Monitoring Transaction Log size

Поиск
Список
Период
Сортировка
От Stefan Kaltenbrunner
Тема Re: Monitoring Transaction Log size
Дата
Msg-id 45AE6AF5.4080306@kaltenbrunner.cc
обсуждение исходный текст
Ответ на Re: Monitoring Transaction Log size  ("Joshua D. Drake" <jd@commandprompt.com>)
Список pgsql-performance
Joshua D. Drake wrote:
> Ziegelwanger, Silvio wrote:
>> Hi,
>>
>>
>>
>> how can I monitor the size of the transaction log files using SQL Statements?
>
> You can't. You would have to write a custom function to heck the size of
> the xlog directory.

wel in recent versions of pg it should be pretty easy to do that from
within SQL by using pg_ls_dir() and pg_stat_file().

maybe something(rough sketch) along the line of:

select sum((pg_stat_file('pg_xlog/' || file)).size) from
pg_ls_dir('pg_xlog') as file where file ~ '^[0-9A-F]';

might do the trick


Stefan

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

Предыдущее
От: "Shoaib Mir"
Дата:
Сообщение: Re: Monitoring Transaction Log size
Следующее
От: Scott Marlowe
Дата:
Сообщение: Re: PG8.2.1 choosing slow seqscan over idx scan