Re: MMAP Buffers
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Greg Stark <gsstark@mit.edu>
Cc: Robert Haas <robertmhaas@gmail.com>, Greg Smith <greg@2ndquadrant.com>, Joshua Berkus <josh@agliodbs.com>, Andrew Dunstan <andrew@dunslane.net>, Radosław Smogura <rsmogura@softperience.eu>, Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>, PG Hackers <pgsql-hackers@postgresql.org>
Date: 2011-04-16T15:02:32Z
Lists: pgsql-hackers
Greg Stark <gsstark@mit.edu> writes: > What he did, I gather, is treat the mmapped buffers as a read-only > copy of the data. To actually make any modifications he copies it into > shared buffers and treats them like normal. When the buffers get > flushed from memory they get written and then the pointers get > repointed back at the mmapped copy. That seems much too late --- won't other processes still be looking at the stale mmap'ed version of the page until a write-out happens? I'm pretty concerned about the memory efficiency of this too, since it seems like it's making it *guaranteed*, not just somewhat probable, that there are two copies in RAM of every database page that's been modified since the last checkpoint (or so). regards, tom lane