Also you'll need to run the benchmark test several times to eliminate caching effects. The first run will be skewed by the fact that everything has to be loaded from disk and subsequent runs will be more reliable.

Databases are better organized and utilize complex queries while flat file is just a file.
Databases are also faster.File Management system is old system and time consuming also. And i also voted to Database.

I think most of you need to retake your college programming classes. Flat file will always be faster then a database. Your comparing the output of a compiled language to that of an interpreted one. Not only does the file need to be read by the parser, it has to be checked for errors, turned to byte code and then to opcode for that system and then be executed. In this case a database is normally written in C or C++ and is compiled down already to machine code. It only needs to be loaded into memory and executed. If you wrote this in C it would more then double the flat file results. For php to show such results is fairly impressive but your implementation could be better to speed up the process in php. If it where coded better it would out perform it in all aspects simply because the number of operations it performs would be less regardless of the language it was written in. Your argument is flawed because you do not specify a specific language and arrogantly say that it is faster then flat file. In python, a language actually meant to do such things, it would be faster then the database. If you wrote the code better it would be faster in all areas in php. You have to take into account your using unneeded functions and process. Also php's stl is not the best written either.