c# - Linq to SQL vs Serialization -


I have some tables in the MSSQL database, each has about 5-10 properties, there are some simple organizations among tables, But there are 500,000 to 1,000,000 rows in each table.

There is an algorithm that runs on that data (all), so before running the algorithm, I have no algorithm data to retrieve all the data from the database, only reads it, so I need to recover the data.

I am using SQL from SQL. It takes about two minutes to get all the data. What I want to know is whether the serialization file is and then the deserialization (when necessary) will actually load the data fast.

The data is about 200 MB, and I have no problem saving it to disk. So, would it be faster if the objects were dasarized from the file or using LINQ 2 SQL DataContext?

Any experience with this?

I will argue that LINQtoSQL may not be the best option for such an application. When you are talking about so many objects, you get some overhead to create an object instance (your constant class).

I will choose a solution where a stored procedure is only the ado. Net receives required data The application stores it in memory (memory is cheaper nowadays, 200 MB should not be a problem) and analysis algorithm is run on in-memory data.

I do not think you should store the data on the file. Finally, your database is one or more files that are read by the database engine. So you either

  • let the database engine read your data and you analyze it, or
  • let the database engine read your data, you write it in the file , You have read the file (the same data is reread, but now you do it yourself) and you analyze the data

In the later options, lots of benefits Overheads are included, as far as I can see. / P>

Edit: If your data changes very rarely at times, then you should first consider pre-processing data in the database (in the database or in the file system) prior to analysis and caching. can do. It only makes sense if your preprocessed data can be analyzed (much) faster than raw data, probably some preprocessing can be done in the database.


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -