Re: O_DIRECT in freebsd - Mailing list pgsql-hackers

From Tom Lane
Subject Re: O_DIRECT in freebsd
Date
Msg-id 3964.1067439994@sss.pgh.pa.us
Whole thread Raw
In response to Re: O_DIRECT in freebsd  (Doug McNaught <doug@mcnaught.org>)
Responses Re: O_DIRECT in freebsd  (Manfred Spraul <manfred@colorfullife.com>)
List pgsql-hackers
Doug McNaught <doug@mcnaught.org> writes:
> Christopher Kings-Lynne <chriskl@familyhealth.com.au> writes:
>> A new DIRECTIO kernel option enables support for read operations that
>> bypass the buffer cache and put data directly into a userland
>> buffer. This feature requires that the O_DIRECT flag is set on the
>> file descriptor and that both the offset and length for the read
>> operation are multiples of the physical media sector size.

> Linux and Solaris have had this for a while.  I'm pretty sure it's
> been discussed before--search the archives.  I think the consensus
> was that it might be useful for WAL writes, but would be a fair amount
> of work and would introduce portability issues...

Not for WAL --- we never read the WAL at all in normal operation.  (If
it works for writes, then we would want to use it for writing WAL, but
that's not apparent from what Christopher quoted.)

IIRC there was speculation that this would be useful for large seqscans
and for vacuuming.  It'd take some hacking to propagate the knowledge of
that context down to where the fopen occurs, though.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Doug McNaught
Date:
Subject: Re: O_DIRECT in freebsd
Next
From: Manfred Spraul
Date:
Subject: Re: O_DIRECT in freebsd