如何在SQL中优化SQL查询速度和大字段数据 [英] How to Optimize SQL query speed and Large field data in SQL

查看:419
本文介绍了如何在SQL中优化SQL查询速度和大字段数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当数据达到10000时,我的应用程序花费了10秒钟以上的时间来获取数据.因此,这是一个大问题.如何减少选择语句的时间.在表的结构中,有三个大字段数据,长度为"varchar( 3000)".请帮助,告诉我如何进行优化.

必须查看所有数据.因此,如果表中有10000,则显示10000.它也会分页!现在的问题是如何提高速度和优化!

When the data up to 10000 my application had spent more than 10s get the data.So It big problem.How to reduce the select sentence time.In the structure of the table there have three big field data,length "varchar(3000)".Please help ,tell me how to Optimize.

All of the Data must be see.So if the table have 10000 ,it show 10000.It also pageing !Now the Problem is how improve the speed and Optimize !

推荐答案

您的数据可能需要建立索引,并且可能需要进行一些标准化.用户在给定时间需要10000条大记录的可能性非常小,我建议您可能需要使用某种形式的分页,而不是仅查看查询.
Your data likely needs to have indexing set up and perhaps some normalization needs to occur. The likelihood that a user requires 10000 large records at a given time is highly unlikely and I would suggest that you need to perhaps use some form of paging instead of just looking at the query alone.


您需要分析数据库架构以及为此编写查询的方式.这些信息太少,无法给出正确的响应.

检查查询的执行计划.您也可以使用SQL调整顾问.
You need to analyze your database schema and the way query has been written for that. This is far too less information to give a proper response.

Check the Execution plan for the query. You can also use SQL tuning advisor.


我认为您的数据库未规范化,并且尚未完成索引编制.因此,规范化数据库并建立索引,可以为您提供很多帮助.如果仍然存在与性能相关的问题,请检查查询的执行计划.
I think Your database is not normalized and no indexing has been done. So Normalize your database and do indexing, it can help you a lot. If still you have performance related problems check execution plan for the query.


这篇关于如何在SQL中优化SQL查询速度和大字段数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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