Re: [PHP-DB] MySQL - LIMIT 1 on primary KEY - makes sense?
Bastien Koert napsal(a): 2009/6/3 Martin Zvarík : "SELECT * FROM xxx WHERE primary_id=123 LIMIT 1" Is it useless (LIMIT 1) ? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php It doesn't do anything...you are already returning just the one row since there can only be one primary key record I know, but I thought it might have had a little performance + for the MySQL... but I guess not. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] MySQL - LIMIT 1 on primary KEY - makes sense?
2009/6/3 Martin Zvarík : > "SELECT * FROM xxx WHERE primary_id=123 LIMIT 1" > > Is it useless (LIMIT 1) ? > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > It doesn't do anything...you are already returning just the one row since there can only be one primary key record -- Bastien Cat, the other other white meat -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] MySQL - LIMIT 1 on primary KEY - makes sense?
2009/6/3 Martin Zvarík : > "SELECT * FROM xxx WHERE primary_id=123 LIMIT 1" > > Is it useless (LIMIT 1) ? > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Bastien Cat, the other other white meat -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] MySQL - LIMIT 1 on primary KEY - makes sense?
"SELECT * FROM xxx WHERE primary_id=123 LIMIT 1" Is it useless (LIMIT 1) ? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php