Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/sql-server/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sql server 百万行表中聚集索引和非聚集索引的最佳实践_Sql Server_Sql Server 2008_Indexing_Clustered Index_Non Clustered Index - Fatal编程技术网

Sql server 百万行表中聚集索引和非聚集索引的最佳实践

Sql server 百万行表中聚集索引和非聚集索引的最佳实践,sql-server,sql-server-2008,indexing,clustered-index,non-clustered-index,Sql Server,Sql Server 2008,Indexing,Clustered Index,Non Clustered Index,我们在SQLServer2008中有一个表,其列如下 CLI_ID INSURANCEPOliCY_No INS_Cmpny SUM_ASSURE ........... 这里是CLI_ID,INSURANCEPOliCY\u No是复合主键。表中有超过2 crores的行。现在,我们正在CLI ID上创建一个非聚集索引。这是否会提高搜索性能,或者告诉我任何方法使其更快。非常感谢任何帮助。因为您的主键是CLI ID和INSURANCEPOliCY No的复合键,因此,将在这两者上创建

我们在SQLServer2008中有一个表,其列如下

 CLI_ID
 INSURANCEPOliCY_No
 INS_Cmpny
 SUM_ASSURE
 ...........

这里是CLI_ID,INSURANCEPOliCY\u No是复合主键。表中有超过2 crores的行。现在,我们正在CLI ID上创建一个非聚集索引。这是否会提高搜索性能,或者告诉我任何方法使其更快。非常感谢任何帮助。

因为您的主键是CLI ID和INSURANCEPOliCY No的复合键,因此,将在这两者上创建群集索引,为了提高性能,您应该创建另一个非群集索引,如下所示:

1个客户端Id

2保险单编号