Re: seq scan cache vs. index cache smackdown - Mailing list pgsql-performance

From Greg Stark
Subject Re: seq scan cache vs. index cache smackdown
Date
Msg-id 87k6p93bwt.fsf@stark.xeocode.com
Whole thread Raw
In response to Re: seq scan cache vs. index cache smackdown  (Josh Berkus <josh@agliodbs.com>)
List pgsql-performance
Josh Berkus <josh@agliodbs.com> writes:

> Why is mmap not workable?    It would require far-reaching changes to our code
> -- certainly -- but I don't think it can be eliminated from consideration.

Fundamentally because there is no facility for being notified by the OS before
a page is written to disk. And there's no way to prevent a page from being
written to disk (mlock just prevents it from being flushed from memory, not
from being synced to disk).

So there's no way to guarantee the WAL will be written before the buffer is
synced to disk.



Maybe it could be done by writing and syncing the WAL independently before the
shared buffer is written to at all, but that would be a completely different
model. And it would locking the shared buffer until the sync is done, and
require a private copy of the shared buffer necessitating more copies than the
double buffering in the first place.

--
greg

pgsql-performance by date:

Previous
From: "Merlin Moncure"
Date:
Subject: Re: seq scan cache vs. index cache smackdown
Next
From: "Magnus Hagander"
Date:
Subject: Re: seq scan cache vs. index cache smackdown