GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Oracle  >  SQL
Go To First  |  Previous Question  |  Next Question 
 SQL  |  Question 108 of 171    Print  
How does an index work? I know it uses rowid but want to know the exact process.

  
Total Answers and Comments: 3 Last Update: December 14, 2006     Asked by: sravan1 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
December 12, 2006 01:02:53   #1  
rajsrinu Member Since: December 2006   Contribution: 2    

RE: How does an index work? I know it uses rowid but w...
index works for fast retriving data. and it will not allows duplicates you can use index on column(s) not on tables
 
Is this answer useful? Yes | No
December 13, 2006 02:02:25   #2  
sibgatullah        

RE: How does an index work? I know it uses rowid but w...
effective use of index will speed up your query execution time.
 
Is this answer useful? Yes | No
December 14, 2006 12:44:49   #3  
ashok rajagopal        

RE: How does an index work? I know it uses rowid but w...

This is how the index works in simple terms.

When you add a row to a table the rowid of that row plus a few other info is store in a separate area which is dedicated to keep it. Lets say you define a unique index. When you insert a valid row the rowid + the key of the index is stored in the index region ( i forgot what it's called physically ). So a repository which says for this key so and so is the rowid is created. When you try to fetch out the row containing that key SQL engine looks into this region finds out the rowid and moves to that location.

Things work pretty much the same way for all the type of indexes. For a non unique index it will be a single key and a number of rowids. That means for this key(or group of keys) all these rowids are possible. SQL engine takes this info and goes to find out those particular rowids.


 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape