I am an expert unix scripter, and I can easily do the project in less than one day using scripts on a csv file. However, if you plan on using the scripts over and over, I will create an easy to use flat-file database for you that will be talored to this dataset. I can include functions like one for dumping to a csv, or inserting a csv into the database, and executing those 2 functions you listed in the description would be lightning fast. No need for dealing with the overhead of using php or sql, as these will only slow searching down.