Re: Getting all tables into memory

Поиск
Список
Период
Сортировка
От Robert Fitzpatrick
Тема Re: Getting all tables into memory
Дата
Msg-id 1201199713.31394.85.camel@columbus.webtent.org
обсуждение исходный текст
Ответ на Re: Getting all tables into memory  (Bill Moran <wmoran@potentialtech.com>)
Список pgsql-general
On Thu, 2008-01-24 at 10:46 -0500, Bill Moran wrote:
> In response to Robert Fitzpatrick <lists@webtent.net>:
>
> > How can I tell if PgSQL is using memory or not and
> > how much?
>
> Well, top is helpful.  Also, consider installing the pg_buffercache addon
> so you can see how much of your shared_buffers is being used.

Well, all of it I guess from looking below? Again, just learning here...

maia=# select count(*) from pg_buffercache;
 count
-------
 64000
(1 row)
maia=# select count(*) from pg_buffercache where relfilenode is null;
 count
-------
     0
(1 row)
maia=# SELECT c.relname, count(*) AS buffers
               FROM pg_class c INNER JOIN pg_buffercache b
               ON b.relfilenode = c.relfilenode INNER JOIN pg_database d
               ON (b.reldatabase = d.oid AND d.datname = current_database())
               GROUP BY c.relname
               ORDER BY 2 DESC LIMIT 10;
         relname         | buffers
-------------------------+---------
 bayes_token             |   16684
 bayes_token_idx1        |   10264
 maia_sa_rules           |    8501
 pg_toast_70736          |    5898
 maia_mail               |    4361
 maia_sa_rules_triggered |    3913
 maia_mail_recipients    |    3603
 bayes_token_pkey        |    3199
 maia_stats              |    2545
 token_idx               |    2442
(10 rows)

Thanks again for any insight?

--
Robert


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

Предыдущее
От: "Dominique Bessette - Halsema"
Дата:
Сообщение: unique constraint
Следующее
От: Tom Lane
Дата:
Сообщение: Re: REINDEX on large DB vs. DROP INDEX/CREATE INDEX