views:

96

answers:

3

I've bought a CSV United States business database with ~20 million records, which is divided to 51 databases, every database represents a state.

I need to write an ASP.NET MVC Web Application that will query this database, by state and more arguments. Should I create a SQL Server database and import all the records in the all 51 csv files? Or maybe should I query directly to the csv files? What will be fastest? Feel free to suggest and other solutions.

Thanks.

+5  A: 

One table, with appropriate indexes. 20 million records is peanuts.

Ignacio Vazquez-Abrams
@Ignacio struts his funky stuff, I'm too timid to agree that 20x10^6 records is peanuts, but I would go so far as to venture the opinion, in complete agreement, that it should be easily manageable with any serious DBMS. +1 for the bold Ignacio.
High Performance Mark
+1  A: 

I would import the data into one big database. As long as the table is correctly indexed it will offer better performance when querying as instead of having to scan each file it should be able to use the correct indexes to speed things up.

Kevin Ross
+5  A: 

Create a single database, where you put all those records in. But, do it in a structured fashion offcourse.

For instance, you could create a table 'State', and a table called 'Business'. Create a relationship between those 2 tables. Normalize your database further.

When you want to have a performant database, it starts by defining a good, normalized DB schema. Add the necessary indexes, and you should be fine.

A database is designed to be able to handle a large amount of records.

Frederik Gheysels