优化SQL Server表 [英] Optimizing a SQL Server Table

查看:63
本文介绍了优化SQL Server表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尊敬的先生/女士,



我有一个包含22列的表,当我选择该表时,需要4秒的时间和逻辑读取统计数据那张桌子是11,159。请帮我减少逻辑读数统计。



我的查询是



Dear sir/Madam,

I have a table containing 22 columns, when I select that table, it takes 4 seconds elapsed time and the logical read statistic for that table is 11,159. Kindly help me to reduce the logical read statistic.

My query is

SET STATISTICS TIME ON;
SELECT * FROM dbo.tblVendor WITH(NOLOCK)

推荐答案

检索更少的行,或检索每行的列数较少 - 或两者都有。



如果您要使用它,您应该只获取一列:例如,如果您的一列是图像,那么不必要地获取它会占用大量内存和带宽。
Retrieve less rows, or retrieve less columns for each row - or both.

You should only fetch a column if you are going to use it: For example if one of your columns is an image then fetching it unnecessarily will use a lot of memory and bandwidth.


请仔细阅读OriginalFriff的回答和他的评论。



In这个案例我建议你阅读有关问题和服务器的优化和性能。

如何:优化SQL查询 [ ^ ]

SQL Server优化 [ ^ ]

SQL性能 [ ^ ]



正如OriginalGriff所提到的,你需要知道分页数据是减少显示它们所需时间的主要方法。

解决方法:使用ListView Web服务器控件显示,分页和排序数据 [ ^ ]

在Gr中寻呼idView Web服务器控件 [ ^ ]
Please, carefully read OriginalFriff's answer and His comments.

In this case i'd suggest you to read about optimization and perfomance for quesry and server.
How To: Optimize SQL Queries[^]
SQL Server Optimization[^]
SQL performance[^]

As OriginalGriff had mentioned, you need to know that paging data is the main method to decrease time needed to display them.
Walkthrough: Displaying, Paging, and Sorting Data Using the ListView Web Server Control[^]
Paging in a GridView Web Server Control[^]


这篇关于优化SQL Server表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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