ODP.Net - OracleDataReader.Read very slow

前端 未结 2 1352
囚心锁ツ
囚心锁ツ 2021-01-27 14:16

I\'m having a lot of trouble with the OracleDataReader in ODP.Net. Basically, I have a parameterized query that takes anywhere from 1-5 seconds to run (returning around 450 rec

2条回答
  •  南方客
    南方客 (楼主)
    2021-01-27 14:54

    May be I am wrong, but you actually fetch the data in this row: While dr.Read, and not when you are executing the reader. So this can explain why even without doing nothing, dr.Read take all your time.

    I'd try to change your command to

    1). Run plain sql (without parameters)

    2). Run using regular (not binding variable) parameter

    3). Move the sql code to Stored Procedure if possible

提交回复
热议问题