教你50招提升ASP.NET性能(五):确保分页是在数据层完成的

(11)Make sure paging is conducted at the database layer

招数11:

确保分页是在数据层完成的

When using grid UI controls (framework based, or 3rd party owned), you should carefully consider how paging is implemented. Many controls implement paging in a simplistic fashion, where the database is required to return all available data and the control limits what is shown. This strategy is fraught with performance problems, as it means that all the data in the given set must be extracted from the database (e.g. all customers or orders). Depending on the records involved, this could cause significant problems.
使用Grid UI控件(基于框架,或者三方拥有)的时候,你应该认真考虑分页是如何实现的。许多控件用简单时尚的方式实现分页,数据库需要返回所有可用的可视范围内的数据。这种策略充满了性能问题,因为它意味着所有当前设置的数据必须从数据库获取(例如:所有的客户或者订单)。根据相关记录,这会引起严重的问题。

posted @ 2013-07-08 14:13  安布雷拉  阅读(236)  评论(0编辑  收藏  举报