DB page cache/query performance

From: "George Pavlov" <gpavlov(at)mynewplace(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Subject: DB page cache/query performance
Date: 2008-05-14 21:20:00
Message-ID: 8C5B026B51B6854CBE88121DBF097A8602212071@ehost010-33.exch010.intermedia.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I am on PG 8.1.10 on RedHat Linux. Some page cache/query performance
questions:

Is there a way to tell whether a query is satisfied from memory cache or
from disk. The only way I know of is based on the time the query takes
(reported by EXPLAIN ANALYZE) -- comparing the first-time performance
(after dropping the Linux page caches "echo 3 >
/proc/sys/vm/drop_caches" and restarting the server) vs. subsequent
invocations.

Can I calculate exactly (based on PG config and OS parameters) the
amount of memory available for DB page caches? Can someone walk me
through the calculation or point me to a "for dummies" version.

Also, how long should pages stay in the cache? (Assuming I have way more
memory than the total size of all the tables/indexes.) Is there any
time-based expiration (in addition to LRU-based, which in my case should
never be resorted to)?

All of this is prompted by watching the performance of some queries that
according to my understanding should be served from page cache always
(except for the first time after the server starts) -- instead they
periodically exhibit execution times that look like they are not coming
from cache.

TIA,

George

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Greg Smith 2008-05-14 23:18:58 Re: DB page cache/query performance
Previous Message Justin 2008-05-14 20:55:49 Re: rounding problems