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)
 Listing Indexes, used for executing a query.

Author  Topic 

abhilashca
Starting Member

2 Posts

Posted - 2009-06-11 : 07:51:33
Hi developors,
I'm having some tough time with MS-SQL Server Indexing.

I've a table (say LogTable) and I've done a couple of indexing.

Is there any method to identify which all Indexes are used, while a query is executed against a table.

Let the query be:
SELECT * FROM Logs WHERE LogDescription='Some_Value' ORDER BY LogDate DESC.

And I've created some Index say Index_LogDesc and Index_LogDt. Then, is there any query/method to list Indexes that are used when running the above SELECT query?

Hoping, I have'nt confused and is clear.
Any help will be appreciated.

Thanks.



Sometimes... Difficult things are possible.

Transact Charlie
Master Smack Fu Yak Hacker

3451 Posts

Posted - 2009-06-11 : 08:04:32
Are you actually using sql server 2000? or do you have 2005?

YOu can look at the execution plan. Can tell if the table is been scaned or index seeked there)


Charlie
===============================================================
Msg 3903, Level 16, State 1, Line 1736
The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION
Go to Top of Page

abhilashca
Starting Member

2 Posts

Posted - 2009-06-11 : 09:11:19
Hi Thanks for the reply.
I'm using execution plan.

SET SHOWPLAN_TEXT ON

This returns detailed information about how the statements are executed. Also, this returns the Indexes used for executing a query.
Here comes the real problem.

In the previous sample query, (SELECT * FROM Logs WHERE LogDescription='Some_Value' ORDER BY LogDate DESC.
). The result(execution plan) only shows the Index -> Index_LogDt; but not the index -> Index_LogDesc. Instead of showing the descending index, a SORT() statement is displayed along with the result.

Is there any query/statement that is capable to show all the Indexes associated/used for executing a query?

Hoping the secnario is clear now.
Thanks again for your help and looking forward for your reply.



Sometimes... Difficult things are possible.
Go to Top of Page
   

- Advertisement -