SQL INDEX数据库查询 [英] SQL INDEX DATABASE QUERY

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

问题描述

全部好,



我在我的SQL数据库中有一个非常大的数据,并且数据库需要花费很多时间才能获得

QUERY执行。执行需要4352ms,我希望它减少到1500ms。



因为我使用了INDEX QUERY(聚集和非聚集索引),但没有得到结果。

以下是我的索引查询示例。



语法: -



CREATE NONCLUSTERED INDEX index_name

ON tbl_name()

INCLUDE()



但我没有得到结果,

AnyOne可以帮助我。





谢谢



我尝试了什么:



语法: -



CREATE NONCLUSTERED INDEX index_name

ON tbl_name()

INCLUDE()



CREATE CLUSTERED INDEX index_name

ON tbl_name()

INCLUDE()

解决方案

有n o我们可以告诉您如何改善性能,因为我们无法看到您的数据库或其中的数据。它可能是缺乏索引,可能是糟糕的统计数据,或者它可以很好地进行优化。



我会;但是,建议使用数据库引擎优化顾问。在Sql Management Studio中,将Sql放入新的查询窗口。然后单击Tools,Database Engine Tuning Advisor。然后完成其余步骤。



顾问将执行您的查询,然后就如何提高性能提出建议。您可能希望实施一些建议。但是,不要盲目地做这些,确保查看它们并理解它们。


HELLO ALL,

I HAD A VERY LARGE DATA IN MY SQL DATABASE ,AND DATABASE IS TAKING TOO MUCH TIME FOR
QUERY EXECUTION.It taking 4352ms for execution,I want it to decrease upto 1500ms.

As i had use the INDEX QUERY(CLUSTERED AND NONCLUSTERED INDEX),BUT NOT GOT THE RESULT.
FOLLOWING ARE MY INDEX QUERY EXAMPLE.

syntax:-

CREATE NONCLUSTERED INDEX index_name
ON tbl_name()
INCLUDE()

But I am not getting the result,
AnyOne can help me out.


Thank you

What I have tried:

syntax:-

CREATE NONCLUSTERED INDEX index_name
ON tbl_name()
INCLUDE()

CREATE CLUSTERED INDEX index_name
ON tbl_name()
INCLUDE()

解决方案

There is no way we can tell you what to do to improve the performance because we cannot see your database nor the data in it. It could be a lack of indexes, could be bad statistics, or it could be well optimized as is.

I would; however, recommend using the Database Engine Tuning Advisor. In Sql Management Studio put the Sql into a new query window. Then click Tools, Database Engine Tuning Advisor. Then go through the rest of the steps.

The advisor will execute your query and then make recommendations on how to improve performance. You'll likely want to implement some of the recommendations. But don't just do them all blindly, make sure to look them over and understand them.


这篇关于SQL INDEX数据库查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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