Using * in SELECT Query

Posted by libregeek on Stack Overflow See other posts from Stack Overflow or by libregeek
Published on 2010-03-18T10:51:32Z Indexed on 2010/03/18 11:01 UTC
Read the original article Hit count: 324

I am currently porting an application written in MySQL3 and PHP4 to MySQL5 and PHP5.

On analysis I found several SQL queries which uses "select * from tablename" even if only one column(field) is processed in PHP. The table has almost 60 columns and it has a primary key. In most cases, the only column used is id which is the primary key.

Will there be any performance boost if I use queries in which the column names are explicitly mentioned instead of * ? (In this application there is only one method which we need all the columns and all other methods return only a subset of the columns)

© Stack Overflow or respective owner

Related posts about mysql

Related posts about php