在SQL Server中使用过滤索引的最佳方法 [英] Best way to use filtered index in SQL server

查看:66
本文介绍了在SQL Server中使用过滤索引的最佳方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在一个表上使用sql server中的过滤索引,其中一个表有多个行,单个对应的Id(geteroryId),并且这个Id总是会出现在where子句中,所以我如何在这个列上实现非聚集索引



我尝试过:



查询将如下所示,

I want to use filtered index in sql server on a table where one table has multiple row with single corresponding Id(geteroryId), and this Id always will come in where clause so how I can implement non clustered index on this column

What I have tried:

The query will be like this,

select quntity from table name where geteroryId = 2





我只想在数量列上实现索引。请帮助。



I just want to implement index on quantity column..Please help.

推荐答案

Create NonClustered Index [NOC_CategoryID] on tablename geteroryId ASC 


这篇关于在SQL Server中使用过滤索引的最佳方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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