Re: How do I measure user disk usage on Postgresql table?

Поиск
Список
Период
Сортировка
От Richard Huxton
Тема Re: How do I measure user disk usage on Postgresql table?
Дата
Msg-id 4808991E.7060501@archonet.com
обсуждение исходный текст
Ответ на How do I measure user disk usage on Postgresql table?  ("Dave" <withheld@nospam.thanks>)
Список pgsql-general
Dave wrote:
> Lets say I have a Postgresql table where I store uploaded data for
> all users, identified by user_id column. Is it possible to run a
> query to measure the storage a user is consuming?

Not really. You could get the size of the whole table with
pg_relation_size() and then estimate a user's share by seeing what % of
rows have their user-id.

If it's the sort of thing you'll be checking constantly, then I'd keep a
summary table up-to-date using triggers instead.

Oh - if you're going to be asking questions regularly then you'll
probably get more answers if you have a valid email address.

--
   Richard Huxton
   Archonet Ltd

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

Предыдущее
От: Terry Lee Tucker
Дата:
Сообщение: Re: How to retore a pg_dumpall dump?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: good experience with performance in 8.2 for multi column indexes