July 2010
Intermediate to advanced
840 pages
16h 33m
English
You should create indexes on the tables of your database to optimize your query search time, but do not create any more indexes than are absolutely needed. Indexes have to be updated and possibly reorganized when you INSERT, UPDATE, or DELETE a row in a table.
Too many indexes can result in extra time spent tending indexes that are seldom used. But even worse, the presence of an index can fool the optimizer into using it when it should not. For example, let’s look at the following simple query:
SELECT * FROM Warehouse WHERE quantity = 500 AND color = 'Purply Green';
With an index on color, but not on quantity, most optimizers will first search for rows with color = 'Purply Green' via the index, then apply the quantity ...
Read now
Unlock full access