View Single Post

   
  #2 (permalink)  
Old 02-28-2008, 11:27 AM
J.O. Aho
 
Posts: n/a
Default Re: adding LIMIT 1 to improve performance?

Lo'oris wrote:
> If I have a query that WILL affect only one row (or none), because it
> has a condition such as " WHERE primary_key='$x' ", adding "LIMIT 1"
> will improve performance, or mysql is smart enough anyway?
>
> I ask this because I noticed phpmyadmin often does that in situations
> like this, so this doubt hit me.
>
> Thanks (hope I explained clearly enough).
>

Here is the official version with some user comments:
http://dev.mysql.com/doc/refman/5.0/...imization.html

--

//Aho
Reply With Quote