First one is faster, especially if you work with large tables that contain plenty of columns.
Even you have just two columns called name1
and name2
, specifying their names should avoid extracting column names from table structure on MySQL side. So it should be faster than using *
selector.
However, test your results using microtime() in PHP against large tables and you'll see what I'm talking about. Of course, if you have 20+ columns in table and you want to extract them all it's easier to put *
than listing all those column-names but in terms of speed, listing columns is bit quicker.
The best way to check out this conclusion, is to test it by yourself.