MySQL - LIMIT 1 on primary KEY - makes sense?

MySQL - LIMIT 1 on primary KEY - makes sense?

am 03.06.2009 21:55:52 von Martin Zvarik

"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: MySQL - LIMIT 1 on primary KEY - makes sense?

am 03.06.2009 22:17:38 von Phpster

2009/6/3 Martin Zvar=EDk :
> "SELECT * FROM xxx WHERE primary_id=3D123 LIMIT 1"
>
> Is it useless (LIMIT 1) ?
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



--=20

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: MySQL - LIMIT 1 on primary KEY - makes sense?

am 03.06.2009 22:18:20 von Phpster

2009/6/3 Martin Zvar=EDk :
> "SELECT * FROM xxx WHERE primary_id=3D123 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
--=20

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: MySQL - LIMIT 1 on primary KEY - makes sense?

am 03.06.2009 22:31:00 von Martin Zvarik

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

Multiple result sets using PDO and PostgreSQL.

am 04.06.2009 19:19:14 von Matthew.Hartman

Is it possible?=20

I have created a function to return "setof refcursor" and it executes
correctly, but PDO fails when I call nextRowset.=20

If anyone has an answer and wants StackOveflow points, I posted this
here (with more details too).
http://stackoverflow.com/questions/951628/can-you-return-mul tiple-result
-sets-using-pdo-and-postgresql



Matthew Hartman
Programmer/Analyst
Information Management, ICP
Kingston General Hospital
(613) 549-6666 x4294


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php