To me it's just more like question of sanity, readability and common sense.
When you need only name
- why not to write it explicitly?
It will make your query a lot more informative to the reader.
But when I see poor developers writing dozens of field names explicitly only to follow this "performance" crap - it makes me hurt.
An important note from the comments:
It's indeed important to write the code that doesn't rely on the order or number of fields in the query.
So, just use *
, fetch associative array and your code will never break for such a silly reason.
For my humble tests I've got some difference. 0,0002 fraction of second.
Well, if such a difference is a certain bottleneck for your application - go for explicit writing fields (although it will take a parser more time to parse your query, hehe :)
However, in my realm performance concerns starts from at least 0,001s difference. So, I wouldn't bother.