ODATA是否在数据库或IIS主机上进行过滤?
如果我使用odata3和ef,在ASP.NET中实现以下API toystore.com/api/toys?$ Select = prodid&Amp;该查询是否在我的数据库(索引且擅长过滤)上进行评估,还是我检索所有100K行,然后在内存中将其在IIS Weberver上过滤?如果是后者,则有一种方法可以使这种表现更具性能。谢谢
编辑 - 澄清... “可以” ASP.NET ODATA查询曾经在数据库上过滤,还是在IIS上评估的始终?
if I implement the following api toystore.com/api/toys?$select=prodId&$filter=startswith(CompanyId,'lego') in ASP.NET, MVC, using odata3 and EF. Does that query get evaluated on my database (which is indexed and good at filtering) or do I retrieve all 100k rows and then filter them on my IIS webserver in memory? If it's the latter is there a way to make this more performant. thanks
edit - clarifying...
"can" asp.net odata queries ever filter on the database or are they always evaluated on the IIS?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您使用Iqueryable返回,则在SQL查询中添加条件。因此,它不会从数据库中获取所有数据。如果您返回iEnumerable而不是Iqueryable,它将拉出所有数据并在IIS中过滤。
我希望我有帮助。
If you return with IQueryable, where condition will be added in sql query. Thus, it will not pull all the data from the database. If you return an IEnumerable instead of IQueryable, it will pull all the data and filter it in iis.
I hope I have helped.