I'm writing a simple program in C# which stores some data and th开发者_Go百科en use simple queries to generate reports, ... .
the data are about a million records.
what's an efficient way to do this? should I use MsSql, MySql, ..., or there is a easier way to manage and use this amount of data?
UPDATE: actually by efficient I meant simple. I want my program to standalone if possible. using simple files for storing data, etc. but I don't want to create everything from scratch.
tnx
Probably either MS SQL Server or MySQL would be just fine. Both systems are used for commercial products and have a robust set of tools for something like that.
Look into SQL Express, which is a lite version of SQL Server. And it's free. SQL Server Express
There is also SQL Server Compact which you can actually embed into your application (no need for a server or installation).
You definitely should use SQLite or Firebird if you want your program to be standalone and simple. Those databases are quite fast, also. From my experiences, SQLite is a word class standalone/embeddable database. I'd prefer it over SQLServer Compact edition and other candidates.
Richard is correct, any of the main stream database engines will be sufficient. Since you're dealing with a lot of data, you'll want to consider adjusting your schema as needed for reporting, or create aggregate roll-up tables to make reports run faster. There's no reason to query old data over and over again when doing aggregate operations. Lastly, make sure you create the appropriate indexes on the columns you're filtering and ordering by.
Good Luck!
I suggest using SQL Server Compact. It uses the microsoft stack so should be easy to use with C#. Also, since it is an embedded database it doesnt need a server to run on - it will run stand-alone.
http://msdn.microsoft.com/en-us/library/ms144275.aspx
精彩评论