Search the MySQL manual:

5.2.3 Speed of SELECT Queries

In general, when you want to make a slow SELECT ... WHERE faster, the first thing to check is whether you can add an index. See section 5.4.3 How MySQL Uses Indexes. All references between different tables should usually be done with indexes. You can use the EXPLAIN command to determine which indexes are used for a SELECT. See section 5.2.1 EXPLAIN Syntax (Get Information About a SELECT).

Some general tips:

User Comments

Add your own comment.