Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is faster SELECT * or SELECT `field` when only requiring `field`

Tags:

sql

mysql

I don't want to assume here, I've been bitten/proven wrong before.

Any help would be appreciated

like image 879
liamfriel Avatar asked Sep 11 '25 07:09

liamfriel


1 Answers

SELECT field is faster than select *.

Because if you have more than 1 field/column in your table then select * will return all of those, and that requires network bandwidth and more work for the database to fetch all the other fields. But if you only require one field/column, the database load is less and it doesnt need to transmit unneeded information and thus take bandwidth resources uncesseraly.

like image 72
rapadura Avatar answered Sep 12 '25 20:09

rapadura