Specifying query index

You can use the (index index_name clause in select, update, and delete statements to specify the index to use for a query. You can also force a query to perform a table scan by specifying the table name. The syntax is:

select select_list
    from table_name [correlation_name]
       (index {index_name | table_name } )
       [, table_name ...]
    where ...

delete table_name 
    from table_name [correlation_name]
    (index {index_name | table_name }) ... 

update table_name set col_name = value
    from table_name [correlation_name]
    (index {index_name | table_name})...

For example:

select pub_name, title
    from publishers p, titles t (index date_type)
    where p.pub_id = t.pub_id
    and type = "business"
    and pubdate > "1/1/93"

Specifying an index in a query may be helpful when you suspect that the query processor is choosing a suboptimal query plan. When you do specify the index:

Use (index index_name only after testing when you are certain that the query performs better with the specified index option. Once you include an index specification in a query, regularly verify that the resulting plan is still better than other choices made by the query processor.

If a unclustered index has the same name as the table, specifying a table name causes the unclustered index to be used. You can force a table scan using select select_list from tablename (0).

Specifying indexes has these risks:

Before specifying an index in queries: