Re: How does PG know if data is in memory? - Mailing list pgsql-performance

From Jeremy Harris
Subject Re: How does PG know if data is in memory?
Date
Msg-id 4CAA5974.2050805@wizmail.org
Whole thread Raw
In response to Re: How does PG know if data is in memory?  (Greg Smith <greg@2ndquadrant.com>)
Responses Re: How does PG know if data is in memory?  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-performance
On 10/04/2010 04:22 AM, Greg Smith wrote:
> I had a brain-storming session on this subject with a few of the hackers in the community in this area a while back I
haven'thad a chance to do something with yet (it exists only as a pile of scribbled notes so far). There's a couple of
waysto collect data on what's in the database and OS cache, and a couple of ways to then expose that data to the
optimizer.But that needs to be done very carefully, almost certainly as only a manual process at first, because
somethingthat's producing cache feedback all of the time will cause plans to change all the time, too. Where I suspect
thisis going is that we may end up tracking various statistics over time, then periodically providing a way to export a
massof "typical % cached" data back to the optimizer for use in plan cost estimation purposes. But the idea of
monitoringcontinuously and always planning based on the most recent data available has some stability issues, both from
a"too many unpredictable plan changes" and a "ba 
d
> short-term feedback loop" perspective, as mentioned by Tom and Kevin already.

Why not monitor the distribution of response times, rather than "cached" vs. not?

That a) avoids the issue of discovering what was a cache hit  b) deals neatly with
multilevel caching  c) feeds directly into cost estimation.

Cheers,
    Jeremy

pgsql-performance by date:

Previous
From: Cédric Villemain
Date:
Subject: Re: How does PG know if data is in memory?
Next
From: Tom Lane
Date:
Subject: Re: Issue for partitioning with extra check constriants