I have a table with a lot of rows (~ 200 million), and I want to process these values ββin C # after reading them from memory. Processing requires grouping records by column values ββin a way that cannot be performed inside the SQL server itself. The problem is that reading all the data at once gives me an OutOfMemory exception and takes a long time to complete even partially.
So, I want to break my request into shorter fragments. One method is to obviously make an independent choice and then use the where in clause. Another method I suggested is using sql cursors. I want to choose one of these methods (or, if possible, another), especially regarding the following points:
- What will be the influence of the schemes on the server? What will work faster?
- Is it possible to safely parallelize sql cursor queries? Do I get performance benefits if I parallelize the first circuit (the one with which in the section)?
- How many objects can be specified in the where in section? Is it limited only by the size of the query string?
Any other suggestions are also welcome.
Edit1: They gave me different solutions, but I still would like to know the answers to my original questions (out of curiosity).
source share