Re: [HACKERS] RAW I/O device - Mailing list pgsql-hackers

From Malcolm Beattie
Subject Re: [HACKERS] RAW I/O device
Date
Msg-id E11v1tB-00056M-00@sable.ox.ac.uk
Whole thread Raw
In response to Re: [HACKERS] RAW I/O device  (The Hermit Hacker <scrappy@hub.org>)
List pgsql-hackers
The Hermit Hacker writes:
> If Linux is providing an Interface into the RAW file system, then this may
> change things for Oracle, since it wouldn't have to "learn" all the
> different OSs, as long as the API is the same across them all...and, my
> experience with Linux is that the API for Linux will most likely be
> different then everyone else *roll eyes*

The system admin side is slightly different from others: raw devices
have their own major number and devices, /dev/rawN and you "bind" a
raw device to any existing block device /dev/blockdev by doing   # raw /dev/rawN /dev/blockdev

However, the DBA side (or software) side isn't any different: provided
you access /dev/rawN *only* in sector chunks (i.e. multiples of 512
bytes that are 512-byte aligned) then the software doesn't care
whether it's /dev/rawN or an ordinary block device. If PostgreSQL can
guarantee (or be tweaked/enhanced to guarantee) that it only ever
reads/writes in multiples of 512 byte chunks and never does anything
"weird" (truncates, file-specific, ioctls, mmap, needing O_CREAT to
start with etc.) then it should be perfectly happy when presented with
a /dev/rawN instead of an ordinary file.

--Malcolm

-- 
Malcolm Beattie <mbeattie@sable.ox.ac.uk>
Unix Systems Programmer
Oxford University Computing Services


pgsql-hackers by date:

Previous
From: Daniel Kalchev
Date:
Subject: memory problem again
Next
From: wieck@debis.com (Jan Wieck)
Date:
Subject: FOREIGN KEY and shift/reduce