|
database
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
performance questionsIn a case where I'm not sure how many columns Im going to use should I just
use select * from table1 or select col1, col2, col3, col4... from table1 Is there any disadvantage for using select * in terms of performance or security? Thanks, Howard The Best Practice is to specify only those columns you actually use. This
will give the optimizer more flexibility, such as choosing covering non-clustered indexes, and also reduce network bandwidth requirements. The column list technique also provides a more well-defined application interface that doesn't change when columns are added to tables. From a security perspective, a column list provides vertical partitioning so that data is selectively exposed. -- Show quoteHope this helps. Dan Guzman SQL Server MVP "Howard" <howdy0***@yahoo.com> wrote in message news:%238Bik$6eGHA.2076@TK2MSFTNGP04.phx.gbl... > In a case where I'm not sure how many columns Im going to use should I > just use > select * from table1 > or > select col1, col2, col3, col4... from table1 > > Is there any disadvantage for using select * in terms of performance or > security? > > Thanks, > Howard > > |
|||||||||||||||||||||||