Subject Re: Where is the time does ???
Author Adam
>
> To amplify on that and state the implication explicitly: access via
indexes
> is not always faster than natural access in storage order (despite the
> magic that what some people attribute to indexing).
>

For disk based storage devices anyway. Hard drives have seek times
measured in milliseconds, so if you are pulling data from various
points on the drive, it comes with huge cost.

There are two ways to get your data sorted.

1. Find the first record, then look for the second record, then the
third using an indexed walk.
2. Read all the records in whatever order you find them, then in
memory do the sorting.

Seek times on hard disks are typically 5 to 10 *milliseconds*.
Seek times on solid state devices are measured in *nanoseconds*.

So when disks become more of a niche technology and solid state
storage becomes more of a commodity, indexed walks will look much more
attractive.

The main use for indexed walks on disk technology is that you can
immediately get the first records to the client. If you are filling a
data grid for example, you only need to fetch 30 odd records to fill
the screen, rather than read in 2000 records, sort them, and then
return the first 30.

Adam