Re: to enable O_DIRECT within postgresql - Mailing list pgsql-hackers

From Tom Lane
Subject Re: to enable O_DIRECT within postgresql
Date
Msg-id 24785.1276657536@sss.pgh.pa.us
Whole thread Raw
In response to to enable O_DIRECT within postgresql  (Daniel Ng <danielng1985@gmail.com>)
List pgsql-hackers
Daniel Ng <danielng1985@gmail.com> writes:
>        I am trying to enable the direct IO for the disk-resident
> hash partitions of hashjoin in postgresql.

Why would you think that's a good idea?

> Can anyone advise what's the reason and how to fix this?

Per the open(2) man page:
      The O_DIRECT flag may impose alignment restrictions on the  length  and      address  of  userspace  buffers  and
thefile offset of I/Os.  In Linux      alignment restrictions vary by file system and kernel version and might      be
absententirely.  However there is currently no file system-indepen-      dent interface for an application to discover
theserestrictions for  a      given  file or file system.
 

It's unlikely that the code you're hacking makes any attempt to align
the buffers it's using to read/write files.
        regards, tom lane


pgsql-hackers by date:

Previous
From: "David E. Wheeler"
Date:
Subject: Re: hstore ==> and deprecate =>
Next
From: Takahiro Itagaki
Date:
Subject: Re: debug log in pg_archivecleanup