Re: How does PG know if data is in memory?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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/

--
Sent via pgsql-performance mailing list (pgsql-performance@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance


[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux