The first is faster, especially if you work with large tables that contain many columns.
Even you only have two columns with the name name1 and name2 , specifying their names, you should avoid extracting the column names from the table structure on the MySQL side. Therefore, it should be faster than using the selector * .
However, test your results using microtime () in PHP against large tables and you will see what I am saying. Of course, if you have 20+ columns in the table and you want to extract them, then itβs easier to place * than to list all these column names, but in terms of speed, the enumeration of the columns is a bit faster.
The best way to test this conclusion is to test it yourself.
source share