Jump to content

Noob Database Index Question


Recommended Posts

I do understand that it makes searching quicker.

 

That's an understatement.  Imagine you have a 500 page programming book, and you're asked to find every occurrence of the word "variable".  If the book did not have an index would have to look at every word from page 1 to 500.  The same holds true with a table in a schema.  Imagine you have a table with n rows and you are looking for all rows where column_a = "variable", if the column is not indexed  the rdbms has to look at every row in the table.  This becomes more and more expensive as a function of n.  If you have an index on that column, just as in the book example, the rdbms knows where to look in order to find the rows where column_a = "variable".

 

Best,

 

Patrick

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.