Indexes are added to the tables. You don't 'use' them in your queries (although you can give hints). MySQL will automatically try to use the most efficient access method.
If you are handling large amounts of rows, it will hardly ever be more effecitive to do sorting in PHP.
An index is just what the word suggest: an index.
Compair it with a book.
If the book have a nice wordlist/index, that points you to the page where you can find some information, you can find it rather fast. If there is no index, you will have to go read all pages of the book until you have what you are looking for.
|