logo


72.1.5 Indexing


As the number of records in your database grows, these queries become slower and slower, because the database has to look through the records sequentially, comparing every record to your query example, and then display the record(s) that you are looking for. You think that there must be a better way, so you read further into the documentation and you discover that your flat file database can make use of something called an Index and query much faster.

That makes sense; you associate flat file indexes with the indexes in a book library. Librarians maintain indexed Card Catalogues by Author, by Title, and by Subject. You even recall that the cards are called Index Cards. For example, If you want to find all the books by the author Marie Jones, you look in the Author card catalogue under the “J's” for Jones, and then you look alphabetically through the Jones'es until you get to ‘M’, and then under the M’s for Marie.

Flat file databases use the electronic equivalent of card catalogues. In flat file databases, instead of calling them card catalogues, we call them Indexes. The name Jones will appear in the Last Name index, and the name Marie will appear in the First Name index. When you Query by Example for Marie Jones, the database will quickly find all the records that meet both conditions: Marie as a first name, Jones as a last name.



Harrowex Pty Ltd
http://www.hxmedical.com
Voice:+ 61 4 27 344 279
Fax: +61 3 52 439 019
static@hxmedical.com