自定义ria服务导航查询 [英] Custom ria service navigation query

查看:87
本文介绍了自定义ria服务导航查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在将相当大的数据集加载到TreeView(Telerik RadTreeView)中时遇到性能问题;性能令人震惊.性能问题并不令人惊讶. 30,000+行"数据的.用户很少看 一次处理所有数据.数据来自RIA服务.我关注了Paul van Bladel关于使用按需加载( http://blog.pragmaswitch.com/?p=545)的精彩博客..这大大提高了性能.

I was having some performance issue loading a fairly large data set into a TreeView (Telerik RadTreeView); the performance was shockingly bad. The performance issue was no big surprise; 30,000+ "rows" of data. Users will rarely ever look at all the data at once. The data comes from a RIA service. I followed Paul van Bladel's excellent blog on using OnDemand loading (http://blog.pragmaswitch.com/?p=545). This has improved the performance considerably.

性能可以进一步提高;当第一个节点扩展时,我仍然会受到一些打击.原因是调用了默认查询,该查询返回所有数据,然后对其进行过滤.这不是最有效的方法.以下 是Fiddler的URL

The performance can be improved further; I still take a bit of hit when the first node is expanded. The reason being that the default query is called which returns all the data and then it's filtered. This isn't the most efficient way of doing it. Below is the URL from Fiddler

GET/EventFramesData.svc/Assets()?$filter=Parent/Id%20eq%20guid'4b325bab-ab95-404e-8bc2-0c1946bb030b'HTTP/1.1

GET /EventFramesData.svc/Assets()?$filter=Parent/Id%20eq%20guid'4b325bab-ab95-404e-8bc2-0c1946bb030b' HTTP/1.1

在RIA服务中最好有一个方法,例如GetAssetsByParentId(Guid ParentId).该方法编写起来很简单.问题是如何在LS中获取NavigationProperty来调用此自定义方法而不是默认方法?

It would be better to have a method in the RIA service, say GetAssetsByParentId(Guid ParentId). The method is pretty trivial to write. The question is how do I get the NavigationProperty in LS to call this custom method rather than the default method?

顺便说一句:GUID的使用是因为这是第三方后端系统使用的.

BTW: the use of a GUID is because that is what the 3rd party backend system uses.

推荐答案

迈克,

您能否分享默认的Assets Ria查询的实现形式?根据您描述的行为,我假设您已经以执行查询而不是返回IQueryable对象的方式实现了它.这个 这种方法的效率低下,因为调用者(通常是客户端)指定的,在查询之上组成的任何查询运算符都将在内存中执行,而不是被推送到底层数据存储区中执行.

Can you share what the implementation of your default Assets Ria query looks like?  Based on the behavior you describe, I am assuming you have implemented it in such a way that it executes a query rather than returning an IQueryable object.  This is inefficient in that any query operators specified by the caller (usually the client) that get composed on top of the query will get executed in memory rather than getting pushed to the underling data store to be executed.


这篇关于自定义ria服务导航查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆