May 9, 2003 at 12:34 pm
Hi,
In profiler whenever a SELECT statement is used I always see SELECT * FROM ...... WHERE .... This is a SQL box as a backend for a Web server. I understand that select all columns will flood the network bandwidth with unused data from unneeded columns. I am not a developer, don't know how ASP works with the data returned from SQL.
May 9, 2003 at 12:39 pm
Opps, hit wrong button....
Is it because the developer was too lazy to type the needed column names or anything else?
Thanks.
May 9, 2003 at 4:53 pm
Select * can be bad, it depends. If you're only returning a few rows that isn't nearly as bad as if you're returning 10k rows. It could be laziness, or it could be that they really need all columns. It could also have been a design decision because they think there is a good chance the table will have columns added later and they if that happened, they'd want the columns included. Finally, it's possible they are querying a view and it's common for views to have select *.
As far as flooding the network, you can only run as fast as the slowest part of the network, on most networks you'd have to run a LOT of monster queries to bottleneck any part of it. Good place to start is to look at utilization on the NIC in the sql box.
Andy
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply