.Net - Creating an On-Demand recordset rather than pulling everything into memory at once

前端 未结 2 1190
情深已故
情深已故 2021-01-23 14:02

I don\'t know if this title makes sense, but my situation is as follows:

I\'m writing a .Net program to query an Oracle DB for an enormous amount of history (about 2-yea

2条回答
  •  孤城傲影
    2021-01-23 14:40

    The OracleDataReader won't put all records in memory. Look at the Fetchsize property this controls the amount of records actually cached until we need a second roundtrip to the database.

    If you want Oracle to return rows faster eg., you can try the

    /*+ FIRST_ROWS(n) */
    

    hint in your query vs the

    /*+ ALL_ROWS */ 
    

    hint if you can wait for all the data.

提交回复
热议问题