The tools that the relational database has for solving your query are the indices that have been set up on the tables. The index is the relational databaseโs way of presorting the data into multiple perspectives at the same time. This is done by maintaining the details on the fields in the index and maintaining pointers where the actual data is stored
With the exception of a clustered index, every index comes with a disk storage cost. Clustered indexes are essentially free from a disk read and disk space costs because the clustered index is really the order that the data is stored into the table.
When using an index, the database engine must perform two data reads for every record that is desired out of the database. The first read is into the index to locate the pointer to the actual record. The second is to read the location specified by the pointer. This is a cost consideration that the database server will take into account as it tries to solve your query. Itโs also the primary reason why the query analyzer will choose not to use an index. In a later section, Covering Indices, youโll learn a technique that can eliminate the need for the double readโhowever, in most cases using an index means doing nearly double the number of reads per record.
Answered by
Dan Dan
, an ibibo Specialist,
at
2:55 PM on November 11, 2008