RainLover
VIP From a land downunder
- Local time
- Tomorrow, 08:34
- Joined
- Jan 5, 2009
- Messages
- 5,041
What is indexing?
Indexing is a way of sorting a number of records on multiple fields. Creating an index on a field in a table creates another data structure which holds the field value, and pointer to the record it relates to. This index structure is then sorted, allowing Binary Searches to be performed on it.
The downside to indexing is that these indexes require additional space on the disk, since the indexes are stored together in a table using the MyISAM engine, this file can quickly reach the size limits of the underlying file system if many fields within the same table are indexed.
http://stackoverflow.com/questions/1108/how-does-database-indexing-work
That was just an introduction and a link to the source.
What I would like to know is when is the Index applied. A Field needs to be reindexed whenever a record is either created or edited.
Is this index applied on the saving of a record or perhaps when required. Namely when you do a search.
I am trying to understand what the affect is of reindexing. If it is on save then there should be no change in the overall speed of performing searches etc,
However if it is done when the index is required for searching then it could make a considerable difference to the speed. If several fields are indexed it would do the exact opposite to what we wanted.
If you know the correct answer as to when the indexing is applied please let me know. Then if you know of a link then that would be better still.