Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: OS Block Size - MS Windows NT

Re: OS Block Size - MS Windows NT

From: Nuno Souto <nsouto_at_nsw.bigpond.net.au.nospam>
Date: 2000/03/22
Message-ID: <38d8bc9e.18258697@news-server>#1/1

On Tue, 21 Mar 2000 22:59:33 GMT, Ben Pomicter <bp2k_at_my-deja.com> wrote:

>>
>Well...for what it's worth (and I wonder what) here are two quotes from
>Oracle support:

Yeah....

>
>"Oracle uses non-buffered reads and writes on NT. We therefore bypass
>the NT file system cache and are thus only concerned with I/O in
>multiples of the O/S blocksize (512 bytes)...So if we want to read a 2k
>Oracle block we pass this to the O/S who simply does a 2k read (4
>sectors) from the existing file and passes the results back to Oracle
>and our own buffer cache."

That is not entirely correct. NT does NOT do 2K reads, buffered or unbuffered. IF it is a formatted partition, the low-level I/O routines in NT will ONLY do I/O in multiples of the partition's sector size, whatever that may be. That is why it is important to match the size of sector to the intended use of the partition: to avoid redundant I/O.

(Source: Minasi and Russinovitch: they know a little bit more about NT than ORACLE support...) (additional source: the MS device driver SDK and relevant entries in MSDN).

It could be 2K, it could be any other valid sector size the partition was formatted to. Of course, ORACLE may request 2K (buffered or non-buffered is imaterial here). If the sector size of a partition is for the sake of example 4K, NT WILL read 4K and PASS 2K to ORACLE. Assuming of course proper boundaries in the data being read. I stress again: in THIS PARTICULAR example.

Sector sizes in NT are fixed for a partition at creation time. They are always multiples of 512 bytes and are defaulted to different values depending on size of partition. (same sources)

As an interesting side note, does anyone know WHY is it that sectors are multiples of 512 bytes? Simple: every SCSI (and IDE) disk in the market has a PHYSICAL sector size of 512 bytes. That is a universal standard. So modern disks will NEVER do I/O in ANY size different than multiples of 512 bytes. Older MFM and RLL drives could, but I don't think they are used anymore.
(Source: Forgot his name, a fella that worked at Seagate and sent me the most accurate SCSI and IDE disk timing tester I've ever seen! You should see the difference it makes to read/write from the outer tracks of a disk and the effect physical I/O request size has on the inbuilt disk cache...)

>
>"Oracle does a bypass of NT buffer cache, this is done because the API
>win32 provides a flag called FILE_FLAG_NO_BUFFERING , that is used by
>Oracle when the datafiles are created. Also, you can confirm this doing
>a simple full scan on a large table, several times, and you can observe
>that the response time will be the same"
>

That flag BTW is only available after SP4 and I believe only versions of ORACLE after V8.0 will use it effectively. There was quite a bit of "friction" between ORACLE and Microsoft over that little bit (!). Apparently, MS only told ORACLE about it after they patched it into SQL Server and ORACLE had released V8.0. Coincidence or intentional? Draw your own conclusions.
(Source: ORACLE's and MS's web sites at the time. Cripes, THAT was fun to follow!)

>The mystery continues (?)
>

You bet. But every little 512-byte sector helps... (source: yours truly)

:-)

Cheers
Nuno Souto
nsouto_at_nsw.bigpond.net.au.nospam
http://www.users.bigpond.net.au/the_Den/index.html Received on Wed Mar 22 2000 - 00:00:00 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US