SELECT c.relname, sum(cast(b.isdirty as integer)) AS dirtyBuffers, count(*) AS totalBuffers
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 3 DESC
まあ出来る人にとっては,READMEのクエリを使い続けることが無いと思うのでよいのですが...元ネタはこちらです.
0 件のコメント:
コメントを投稿