On Fri, Jun 21, 2002 at 09:01:17PM -0400, Michael H.Collins wrote:
> I thought i just read that postgresql on ext3 outran oracle on raw
> devices.
Yes, it's funny how all database engines are faster than all other
database engines, isn't it?
> ~Because there are tremendous performance advantages to using RAW I/O if
> ~you're prepared to go to the trouble of dealing with all the niggling
> ~details....
> ~
> ~(some of these advantages are supposedly less visible on modern
> ~hardware and modern systems, but they sure as heck were plainly visible
> ~even a few years ago)
There are (As far as I can think of) two aspects of filesystem vs device
access for database-performance:
1. There is some overhead in doing the operations through the
filesystem. I think this is neglectable with an extent-based
filesystem; for inode-based filesystems it may be messurable, but
I doubt it's an important factor.
2. Caching.
Usually a read operation on a file will cause the file to be cached
in RAM, and if the database-engine caches the same data you're
wasting RAM and slowing down the system. Modern operating system
changes this in two ways:
1. The caching is better, so it's possible for a db-engine to
rely on the os-cache instead of implementing it's own.
2. It's possible to turn off OS cache with raw-io.
There are possible some performance advantages of going through the
filesystem as well. For instance some filesystems use knowledge about
the physical hardware (such as the number of spindels and the chunk-size
of the RAID) to optimize IO. Unless the db-engine duplicate theese
features the OS may be able to do the IO more effectively.
The main reason for switching to using a filesystem is operational
though. I once heard that one of the major db-companies (Oracle?) were
going to start doing this on the default configuration because it would
eliminate all the problems with clueless users that "found" a free
partition and started using it for something else :)
--
Ragnar Kj�rstad
Big Storage