[PHP-DB] MySQL - LIMIT 1 on primary KEY - makes sense?

2009-06-03 Thread 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



Re: [PHP-DB] MySQL - LIMIT 1 on primary KEY - makes sense?

2009-06-03 Thread Bastien Koert
2009/6/3 Martin Zvarík mzva...@gmail.com:
 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-06-03 Thread Martin Zvarík

 Bastien Koert napsal(a):

2009/6/3 Martin Zvarík mzva...@gmail.com:
  

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