在实体框架中设置提取大小

编程入门 行业动态 更新时间:2024-10-28 08:31:14
本文介绍了在实体框架中设置提取大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在将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

更多推荐

在实体框架中设置提取大小

本文发布于:2023-10-26 11:11:49,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1529965.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:实体   框架   大小

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!