|
Posted by David Gillen on 08/03/07 08:37
C. said:
> On 2 Aug, 10:04, Michael Fesser <neti...@gmx.de> wrote:
>> You shouldn't use "SELECT *" in production code, list all columns
>> explicitly.
>>
>> Micha
>
> You shouldn't use "SELECT *" in production code IF YOU CAN list all
> columns
> explicitly.
>
> ...reason being that you're loading more data into the mysql buffer
> than you need, then it gets copied into the PHP variable space.
>
If I want all column in a table though surely SELECT * is better.
In fact, performance on SELECT * is better than "SELECT field1, field2, field3,
field4, field5, field6, field7, field8" because mysql doesn't have to go
looking for the specific fields you've requested but just returns you
everything and since you know you want everything there is no problem.
D.
--
Fermat was right.
Navigation:
[Reply to this message]
|