views:

78

answers:

3

Which do you think would be faster:

A) Reading a file 512 bytes in length on a solid state drive in a directory of 1 billion files

B) Selecting a 512-byte column by unique indexed key from a database table containing 1 billion records

EDIT:

Would the OS, database, or file system really make the difference? Is it that close of a race? Are SSD really that fast? Are databases really that slow?

+4  A: 

The best way to answer this question is to perform a benchmark.

Also, there are many variables to consider. For example: What solid state hardware? What drive would the database be using? What filesystem is being used? What OS? What database?

Asaph
+1  A: 

There are too many variables to give you a definitive answer but, all other things being equal, it is B, because the database is designed from the ground up to handle this kind of work.

Robert Harvey
A: 

You question is: does solid state's directory content index is better / worse than an internal Database index ?

There is no way to calculate this staff, as there are so many more parameters to take into consideration.

in future MS Os there is an idea to make the file system based on a database (some future version of sql server) and then the question might have some more logic inside.

right now, I don't even think you can benchmark this question - as I don't think you can afford to get a 1000GB SSD, and even if you get one- it is so OS dependent that the results can't mean a lot anyway.

Dani