Connecting Tech Pros Worldwide Forums | Help | Site Map

indexes and query optimization

Newbie
 
Join Date: Apr 2007
Posts: 1
#1: Apr 3 '07
I have web page that users use to specify sort and selection critieria for a query. So there is a "most common" type set of where clauses, but they can change. Every time the query is run, there are where clauses on multiple columns, and joins from some columns to other tables, and then it is sorted by a different column.

I am wondering if I should have a clustered index on this table since there are so many columns used in where clauses. Would it be useful to cluster on the column it is sorted by, or should I just stick with nonclustered indexes?
Thanks

iburyak's Avatar
Expert
 
Join Date: Nov 2006
Posts: 1,017
#2: Apr 3 '07

re: indexes and query optimization


If you have sort order by different columns, clustered index will not help.
You can have only one clustered index over a table.
But you can still have none clustered indexes over columns you do order by over.
Reply


Similar Microsoft SQL Server bytes