Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 index

Author  Topic 

fmardani
Constraint Violating Yak Guru

433 Posts

Posted - 2004-11-08 : 05:27:57
There are several fields in a table which I am optimizing.
A few of the fields are in the select clause and a few are in the where clause.
I know that the ones in the where clause should be non-clustered. But do i also add the ones in the select clause to non-clustered too?
Thanks

nr
SQLTeam MVY

12543 Posts

Posted - 2004-11-08 : 06:49:30
Depends what you want to do.
If all columns in the query are in an index then the index will be covering for that query and the data pages will not need to be accessed at all.
But the index will take up more space and so be less efficient.

It's not true that the columns in the where clause should be indexed no rthat they should be non-clustered.
Dpeends on the query and the data distribution what will be best.

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page
   

- Advertisement -