NO Name
NO Name

Reputation: 179

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.

Upvotes: 1

Views: 177

Answers (1)

KM.
KM.

Reputation: 103587

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.

Upvotes: 2

Related Questions