Handling large SQL select queries / Read sql data in chunks

后端 未结 3 1830
抹茶落季
抹茶落季 2020-12-30 10:20

I\'m using .Net 4.0 and SQL server 2008 R2.

I\'m running a big SQL select query which returns millions of results and takes up a long time to fully run.

Does

3条回答
  •  清酒与你
    2020-12-30 11:09

    if you really have to process millions of records Why dont you load 10,000 each round process them and then load the next 10,000? if not consider using the DBMS to filter the data before loading it as the performance on the database is much better than in you logic leyer.

    Or follow a lazy load concept and load only Ids to which you load the actual data only when you need it.

提交回复
热议问题