How does an index work? I know it uses rowid but want to know the exact process.

Questions by sravan1   answers by sravan1

Showing Answers 1 - 9 of 9 Answers

rajsrinu

  • Dec 12th, 2006
 

index works for fast retriving data. and it will not allows duplicates you can use index on column(s) not on tables

  Was this answer useful?  Yes

sibgatullah

  • Dec 13th, 2006
 

effective use of index will speed up your query execution time.

  Was this answer useful?  Yes

ashok rajagopal

  • Dec 14th, 2006
 

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.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions