ODP.Net - OracleDataReader.Read very slow

前端 未结 2 1372
囚心锁ツ
囚心锁ツ 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 15:05

    Work with your DBAs and ask them to capture an explain plan for both the stand alone run (aqua data studio) and your odp.net call and confirm they are in fact the same. If they are not, then that will probably explain your problem. You can then try adding "enlist=false" to your connection string but better yet have the DBA's update the statistics on the related tables, hopefully fixing the slow plan. See https://stackoverflow.com/a/14712992/852208 for more info.

    I have had this same issue and it came down to oracle being less optimistic about the execution plan when a distributed transaction could be involved.

提交回复
热议问题