The task of the query optimizer is to find an optimal plan for executing an SQL query. Because the difference in performance between “ good ” and “ bad ” plans can be orders of magnitude (that is, seconds versus hours or even days), most query optimizers, including that of MySQL, perform a more or less exhaustive search for an optimal plan among all possible query evaluation plans. For join queries, the number of possible plans investigated by the MySQL optimizer grows exponentially with the number of tables referenced in a query. For small numbers of tables (typically less than 7 to 10) this is not a problem. However, when larger queries are submitted, the time spent in query optimization may easily become the major bottleneck in the server's performance. The behavior of the optimizer with respect to the number of plans it evaluates can be controlled using two system variables: The optimizer_prune_level variable tells the optimizer to skip certain plans based on es...
Technology is nothing. What's important is that you have a faith in people, that they're basically good and smart, and if you give them tools, they'll do wonderful things with them.