From: | Robert Fitzpatrick <lists(at)webtent(dot)net> |
---|---|
To: | Bill Moran <wmoran(at)potentialtech(dot)com> |
Cc: | PostgreSQL <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: Getting all tables into memory |
Date: | 2008-01-24 18:35:13 |
Message-ID: | 1201199713.31394.85.camel@columbus.webtent.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On Thu, 2008-01-24 at 10:46 -0500, Bill Moran wrote:
> In response to Robert Fitzpatrick <lists(at)webtent(dot)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
From | Date | Subject | |
---|---|---|---|
Next Message | Dominique Bessette - Halsema | 2008-01-24 18:36:14 | unique constraint |
Previous Message | Greg Smith | 2008-01-24 18:30:25 | Re: pg_xlog and standby - SOLVED |