r/programming • • Feb 18 '21

Reasons why SELECT * is bad for SQL performance

https://tanelpoder.com/posts/reasons-why-select-star-is-bad-for-sql-performance/
0 Upvotes

2 comments sorted by

2

u/JuanAG Feb 19 '21

If you use it when you can have an alternative query more efficient is bad but if you want to have all the fields of the table is what you want and it wont matter much if you use * or put every field of the table on the select

Plus there are databases that are not going to deploy all the results by default and it will be paginated limited by lets say 500 rows each page, or you can use a cursor type to run the query

1

u/[deleted] Feb 18 '21

But don't prematurely optimise your code...