To optimize any application, you must first find out which parts of it take up the most execution time. There are a few ways to do this:
After a slow query has been identified, you can work out how it is being executed by MySQL by using the EXPLAIN statement and can take steps to optimize the query. It is not usually necessary to attempt to speed up all queries in an application. Generally, only a small portion of your code takes up most of the execution time. Unless your system is very, very busy, the programming time spent attempting to accelerate parts that do not take much time is wasted . |