Performance implication of selecting all fields from MYSQL table

QuestionsPerformance implication of selecting all fields from MYSQL table
sethbeckerman5 Staff asked 9 years ago

I use PHP and MYSQL on a Linux webserver and have usually programmed to select all the field of records matched – ie 'SELECT * FROM table1 where field1 like query'. In some cases (as in producing an on-screen index) I then only use 4 or 5 fields from the returned records which have 50 fields.

I imagine if I want to use, say, 49 fields, then selecting all 50 makes sense; but there may be a point (ratio ?) where selecting only the fields required may be more efficient.

Is there a performance implication selecting all the fields rather than selecting just the fields required ?


View on Stack Overflow