Groups | Blog | Home
all groups > sql server clients > may 2005 >

sql server clients : Difference


Joh
5/19/2005 10:33:53 AM
What are the major difference b/w index hint and creating index on column

Thanks

David Gugick
5/19/2005 10:55:26 AM
[quoted text, click to view]

They really can't be compared as you pose the question. You cannot use
an index hint without the index existing and the index can be created on
one or more columns. An index hint tells the optimizer to use a
particular index on a table when executing a query. It's not recommended
users use hints because it prevents the optimizer from generating what
it believes is the best execution plan. Keeping your statistics up to
date can help prevent underperforming execution plans from being used.

In some rare cases, SQL Server may make not make an optimal decision for
a query and you can use a hint to keep SQL Server in line. However, if
you do this, it's extremely important to document the hint and revisit
the query periodically to make sure it continues to work as expected and
to re-test the query without the hint when new service packs are
installed.

--
David Gugick
Imceda Software
www.imceda.com
Joh
5/19/2005 11:42:49 AM
Thanks David...I really appreciate

[quoted text, click to view]

Vinod Kumar
5/25/2005 12:00:00 AM
Index hints forces the optimizer to utilize an index. This restricts the
optimizer from doing what it is good at i.e. finding the optimized plan /
index for the given query based on the data and clauses specified.

--
HTH,
Vinod Kumar
MCSE, DBA, MCAD, MCSD
http://www.extremeexperts.com

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinfo/productdoc/2000/books.asp

[quoted text, click to view]

AddThis Social Bookmark Button