Selecting columns in a query

I've always known this, but I thought I would share it.

I just did a quick performance test on two queries using the Sql Server Profiler.  The difference between the two queries was

Query 1: select * from table where...........

Query 2: select col1, col2, ..... from table where........

There is a small, but noticable performance difference in the two queries.  Query 1 was significantly slower on the first call versus Query 2, somewhat slower on the second call, and performed the same on subsequent calls.  While this was particular to my application, I think it is something I would suggest to all developers to specifically specify the columns in a query.

Wally

4 Comments

Comments have been disabled for this content.