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
 Transact-SQL (2000)
 covering index

Author  Topic 

hey001us
Posting Yak Master

185 Posts

Posted - 2007-05-10 : 21:42:31
Can any one explain about covering index and how to use that?

hey

dinakar
Master Smack Fu Yak Hacker

2507 Posts

Posted - 2007-05-10 : 21:47:28
http://www.sql-server-performance.com/covering_indexes.asp
http://www.mssqlcity.com/Tips/tipInd.htm
and ofcourse books on line too.

Dinakar Nethi
SQL Server MVP
************************
Life is short. Enjoy it.
************************
http://weblogs.sqlteam.com/dinakar/
Go to Top of Page

hey001us
Posting Yak Master

185 Posts

Posted - 2007-05-10 : 21:57:12
Thx Dinakar. I posted this one I read that article, but I don’t know how to use.

hey
Go to Top of Page

hey001us
Posting Yak Master

185 Posts

Posted - 2007-05-10 : 22:06:06
SELECT * FROM tblTaskProcesses (INDEX = IX_ProcessID) WHERE nextprocess = 1 AND processid IN (8,32,45)

Is that above way I need to use? Then IX_ProcessID will be created automatically or do I need to create?


hey
Go to Top of Page

dinakar
Master Smack Fu Yak Hacker

2507 Posts

Posted - 2007-05-11 : 01:17:01
What you have is an index hint. You are yelling at SQL server to use the Index you specify, even if there are better indexes available.
No, you need to create the index inorder to use it. Covering index is including additional columns to an index to "cover" it. Sometimes you have columns that are not index worthy by themselves, as in they dont have enough distribution, like a status column. So you piggy back these columns along with other indexes. You cant just add any column to any index. It should make sense.
From the links I posted:
------
A covering index, which is a form of a composite index, includes all of the columns referenced in SELECT, JOIN, and WHERE clauses of a query. Because of this, the index contains the data you are looking for and SQL Server doesn't have to look up the actual data in the table, reducing logical and/or physical I/O, and boosting performance.
--------


Dinakar Nethi
SQL Server MVP
************************
Life is short. Enjoy it.
************************
http://weblogs.sqlteam.com/dinakar/
Go to Top of Page

hey001us
Posting Yak Master

185 Posts

Posted - 2007-05-23 : 17:10:04
Thank you for your explaination. Cheers

hey
Go to Top of Page
   

- Advertisement -