Re: sequential disk read speed



On Aug 24, 1:26 am, Darren <anon5...@xxxxxxxxx> wrote:
On Aug 21, 12:08 am, David BL <davi...@xxxxxxxxxxxx> wrote:





On Aug 21, 8:36 am, Darren <anon5...@xxxxxxxxx> wrote:

I am learning about database systems, and I am reading a book called
"Physical Database Design".

It gets to a bit about a large sequential access (e.g. for a full
table scan), and does the following:

It says "Since most disk systems use prefetch buffers to speed up
table scans, we
assume a 64 KB prefetch block"

So to calculate the time for a full table scan, it multiples the
number of 64KB blocks by the time it takes to seek and read (2.02ms).
In other words, it is seeking each 64KB block.

Why can a disk only read 64KB at a time? Is this a valid assumption?
Is this a disk limitation or a file system limitation?

A high end modern HD with 4ms average seek will on average take about
7ms to access and an additional 0.5ms to read a randomly located 64k
buffer. This mismatch shows that 64k blocks are too small for
optimal read performance. 512k or 1Mb blocks would be more suitable

But what dictates the block size? Is this defined by the physical
disk, the file system, or the database code?

As far as a physical disk is concerned the term “block” was commonly
used to refer to the intersection of a sector and a track, but now
days “sector” tends to be used instead. It is the smallest unit of
reading/writing and is often 512 bytes. Some disks use 1024 byte
sectors.

A file system provides buffering, and that allows an application to
seek within a file and read/write a single byte. However behind the
scenes an entire sector must be read/written to disk.

Typically a DBMS will read/write the disk without file buffering
provided by the OS. For example on Win32, the function CreateFile can
take the parameter FILE_FLAG_NO_BUFFERING. This forces the DBMS to
work at the granularity of sectors – and it’s fairly low level. Eg
there is a requirement that memory buffers be aligned on 512 byte
boundaries to comply with the DMA constraints.

To avoid excessive seeking the DBMS will tend to organise the store
into much courser units that are typically called “blocks”. The block
size is up to the DBMS, but in practise will always be a multiple of a
sector. In some cases it may relate back to track or cylinder
boundaries, but that constraint is not imposed by the disk controller
(which will happily allow for random access to any sector).

.



Relevant Pages

  • SUMMARY N2: RE: Veritas Volume Manager and Solaris 8 disk space problem
    ... DESC: Commercial File System ... Disk layout version 4 won't support filesistem sizes bigger than 1Tb. ... VERITAS File System disk layout version 6 supports the creation of file ... Sector Count Sector ...
    (SunManagers)
  • Re: Accessing disks via their serial numbers.
    ... When people decide to put their file system onto a mirror, ... partition's last sector, which isn't always safe. ... When disk is already partitioned and file systems are there, ... If they can't adjust the filesystem size (either because the sector ...
    (freebsd-arch)
  • Re: [opensuse] Problems growing a logical volume with LVM tools.
    ... Sector size: 512B/512B ... Partition Table: msdos ... Number Start End Size Type File system Flags ... Model: AMCC 9500S-8 DISK (scsi) ...
    (SuSE)
  • Re: Bad sector on drive ...
    ... If your going to continue to use the disk at least turn on S.M.A.R.T. ... Bad sector on drive ... ... Didn't work, ended up newfs'ng the file system, since the data on the ... if the write succeeds, you're done (and the drive will have ...
    (freebsd-questions)
  • disktab for VPC Disk
    ... I'm trying to optimize the disk access of NEXTSTEP on Virtual PC 5.0.4. ... Maximum size of NeXT file system is 2GB. ... programs in the initial 8 sectors of the device. ... The number of cylinders per cylinder group in a file system. ...
    (microsoft.public.mac.virtualpc)