我正在将ado代码转换为使用EF.在我的ado代码中,我设置了dataReader.FetchSize = command.RowSize * 1000,与默认的获取大小相比,它大大提高了性能. 当我将代码转换为EF时,性能与ado代码相当,在该代码中我未指定获取大小,即在处理大记录时非常慢.
I am converting ado code to use EF. In my ado code i set dataReader.FetchSize = command.RowSize * 1000 and that dramatically improves performance over the default fetch size . When I convert my code to EF, the performance is on par to ado code where I didn't specify fetch size, i.e. it's very slow over large records.
我可以指定获取大小以在EF中检索记录吗?
Any way I could specify fetch size for retrieving records in EF?
推荐答案使用实体框架时,可以在注册表或.NET配置文件中设置ODP.NET FetchSize.这将使所有ODP.NET实例(对于注册表)或应用程序(对于app/web.config)的FetchSize标准化.
You can set ODP.NET FetchSize in the Registry or the .NET config files when using Entity Framework. That will standardize the FetchSize across all your ODP.NET instances (in the case of the Registry) or across your application (in the case of app/web.config).
docs.oracle/cd/E48297_01/doc/win.121/e41125/featConfig.htm
克里斯蒂安·谢伊
Oracle
更多推荐
在实体框架中设置提取大小
发布评论