pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Craig Ringer <craig@postnewspapers.com.au>
To: Richard Troy <rtroy@ScienceTools.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: How does PG know if data is in memory?
Date: Sun, 03 Oct 2010 10:42:45 +0800
Message-ID: <4CA7EDA5.4080401@postnewspapers.com.au> (raw)
In-Reply-To: <Pine.LNX.4.33.1010021626280.8681-100000@denzel.in>
References: <Pine.LNX.4.33.1010021626280.8681-100000@denzel.in>

On 3/10/2010 7:39 AM, Richard Troy wrote:

> I can't speak for modern "OpenVMS", but "back in the day", VMS had a very
> effective memory management strategy which, in effect, made it as if all
> memory was a cache for disk. It did this by means of a mechanism by which
> to identify all potentially reachable disk space. When disk was read in,
> an entry would be made mapping the memory to the disk space from which it
> came - and if it was later updated, the mapping entry was marked "dirty."
> Whenever disk access was contemplated, a check was made to see if it was
> already in memory and if so, it'd provide access to the in-memory copy
> instead of doing the read again. (This also permitted, under some
> circumstances, to reduce write activity as well.)

That's how Linux's memory management works, too, at least if I 
understand you correctly. Pretty much every modern OS does it. Pg is 
reliant on the operating system's disk cache, and has some minimal 
knowledge of it (see effective_cache_size) .

I don't know how shared_buffers management works, but certainly at the 
OS cache level that's what already happens.

-- 
Craig Ringer

Tech-related writing at http://soapyfrogs.blogspot.com/



view thread (31+ messages)  latest in thread

Message-ID: <4CA7EDA5.4080401@postnewspapers.com.au>
Permalink:  ../4CA7EDA5.4080401@postnewspapers.com.au/
Also on:    postgresql.org/message-id/4CA7EDA5.4080401@postnewspapers.com.au

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: craig@postnewspapers.com.au, rtroy@ScienceTools.com
  Subject: Re: How does PG know if data is in memory?
  In-Reply-To: <4CA7EDA5.4080401@postnewspapers.com.au>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox