Every programmer loves to optimize, even when we know we shouldn't. To satisfy your cravings MySQL has several keywords that can be placed in your SQL statement to give the database server an explicit optimization instruction.
I should point out that using the hints incorrectly will
most likley cause your queries to perform worse, so be
sure that it actually makes sense to use them before you go nuts.
This means use EXPLAIN and read the documentation on
each hint before using.
It's also a good idea to enclose the hints within a SQL comment,
for example SELECT /*! SQL_NO_CACHE */ columns FROM
table. This can help to make your application a bit more
portable.
Let's take a look at some MySQL Optimization Hints:
SQL_NO_CACHE
The SQL_NO_CACHE hint turns off MySQL's …