开发者

NonClustered Index in SQl server

I am just doing a performance test on my application database tables . I am not bad in the concept of indexing in sql server .perhaps when i came practical my theories are damn confusing me . hi hi

here my question is , Could you please tell me a scenario in which i need to use multiple non-clustered index on a single table ? .

Do we need more than开发者_运维百科 one index for a single book ? I am confused .

Please help.


Indixing is very complex and beyond the scope of a simple reply here. However, in general, you add indexes onto tables based on how you will read data from the table.

if you have a table:

YourTable
ID          int identity  PK
WidgetName  varchar(10)
WidgetSize  numeric(6,2)

...and you frequently run: SELECT.. WHERE WidgetName='xyz' then add an index on WidgetName if you never SELECT.. WHERE WidgetSize =12.4 then do not add an index for that column.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜