Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQL Query Optimization

Tags:

sql

php

mysql

If I have a table that has 50 columns, will it take less time to use a statement like

SELECT id,name,description FROM table

or will it be the same as if I write

SELECT * FROM table
like image 965
bmbaeb Avatar asked Jun 27 '26 06:06

bmbaeb


1 Answers

Always return the least number of columns possible to satisfy your needs.

like image 132
Joe Stefanelli Avatar answered Jun 28 '26 18:06

Joe Stefanelli



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!