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
 General SQL Server Forums
 New to SQL Server Programming
 need of index

Author  Topic 

born2acheive
Yak Posting Veteran

65 Posts

Posted - 2007-01-08 : 05:23:55
can anybody tell me in which situation we have to use index and please show some examples how to use

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2007-01-08 : 05:44:50
Read about Indexes in Books Online. It is too comprehensive topic to discuss here. But the gist is create indexes on the columns which you frequently use in your WHERE clause.

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

born2acheive
Yak Posting Veteran

65 Posts

Posted - 2007-01-08 : 05:58:06
hi harsh_athalye i searched in google i couldn't find good link ,can u please show some links to study about indexes please
Go to Top of Page

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2007-01-08 : 06:23:13
Books Online is an SQL Server help facility that gets installed with the SQL Server. You need to look there on details of using Indexes.

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

madhuotp
Yak Posting Veteran

78 Posts

Posted - 2007-01-08 : 08:50:00
hi,

if u don't have CD u download the latest BOL from this link

http://www.microsoft.com/technet/prodtechnol/sql/2005/default.mspx

Madhu
Go to Top of Page

jezemine
Master Smack Fu Yak Hacker

2886 Posts

Posted - 2007-01-08 : 23:07:14
http://www.sql-server-performance.com/mr_indexing.asp


www.elsasoft.org
Go to Top of Page

born2acheive
Yak Posting Veteran

65 Posts

Posted - 2007-01-08 : 23:19:09
hi,jezemine,madhuotp thanks a lot for your kind reply
Go to Top of Page

born2acheive
Yak Posting Veteran

65 Posts

Posted - 2007-01-08 : 23:44:18
hi jezemine, i have created index on my dat column which consists of 100 records, i want to check the execution time of this.is it possible to see the execution time or speed?if means please tell me how to see
Go to Top of Page

jezemine
Master Smack Fu Yak Hacker

2886 Posts

Posted - 2007-01-09 : 12:09:14
execution time it not what's important. with only 100 records the query will come back instantly even with no indexes.

what's important is to look at the query plan and see that there are index seeks, and no table/index scans. To look at the plan, you have to execute your query in QA or SSMS with showplan on.

On the other hand, sometimes when there are indexes you still get a table scan if the optimizer thinks doing the bookmark lookups would take more reads than just scanning the entire table. that happens if your query is returning a large fraction of the rows in your tables.

in any case, the subject of proper indexing is too big to discuss here. I suggest you read more of BOL and the articles on http://www.sql-server-performance.com about indexing.


www.elsasoft.org
Go to Top of Page
   

- Advertisement -