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
 Where do indexes physically reside?

Author  Topic 

sixsigma1978
Starting Member

25 Posts

Posted - 2011-09-19 : 12:49:25
Basic question : Am trying to get a picture of what really happens when, say, a where clause is called on a column in an Indexed vs Non-Indexed scenario.
Specifically, in the case of non-clustered index.

So if we search on table with a query WHERE UnitPrice> 15.

If the table is non-indexed, naturally, the column is used - but in case the column is indexed -> What does the query scan perform on? Is the index literally a separate "temp" column which points to each row in table and the WHERE occurs on this temp column?

very elementary question - but I'm trying to get a picture of how a table select works physically!

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-09-19 : 12:54:16
yep. provided it has non clustered index it means there's a separate index table available with index values and pointer to clustered index position of record. Then optimiser will determine whether its easier to traverse the index than to traverse main clustered index and then depending on that it might get index seek,scan or clustered index scan.

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

GilaMonster
Master Smack Fu Yak Hacker

4507 Posts

Posted - 2011-09-19 : 15:19:25
An introductory series on indexing: http://www.sqlservercentral.com/articles/Indexing/68439/

--
Gail Shaw
SQL Server MVP
Go to Top of Page

sixsigma1978
Starting Member

25 Posts

Posted - 2011-09-19 : 16:27:41
thanks - this was helpful! cheers
Go to Top of Page
   

- Advertisement -