Heres a real world scenario I've come across: Code throughout the app is using data returned from a query that has select *, and pulls data from more than one table. Someone adds a column to one of the tables in the query that has the same name as a column in another of the tables in the query.
CF now returns a query with 2 columns named the same and your data is funked up all over the site because using query.columnname is referencing the wrong column. Rey Bango wrote: > Hi Ryan, > > Here are some reasons: > > 1) You're pulling back every row in the specific table that you're > dealing with which DBA's frown upon because you can cripple a database > if you're not careful. > > 2) You're pulling back an unnecessarily large dataset especially if you > only need a couple of columns which in terms requires more memory for > processing by both the DBMS and CF. > > 3) You're not leveraging any of the indexing capabilities of the table > (that is if its actually indexed) so you're performance will be somewhat > degraded. > > I'm sure there's more and others will offer them up. > > Rey... > > Ryan, Terrence wrote: > >> I have a dumb question. Can someone point me to a definitive explanation >> of why select * in SQL is bad? >> >> I've found this : http://www.adopenstatic.com/faq/selectstarisbad.asp >> but I don't thing it effectively counters the argument "But I need all >> of the columns in the table." >> >> Mind you, that I'm not looking for convincing for myself, rather I'm >> doing a code review, and want to be have a stronger footing for saying: >> "Get rid of the select *'s." >> >> Terrence Ryan >> Senior Systems Programmer >> Wharton Computing and Information Technology >> E-mail: [EMAIL PROTECTED] >> >> >> >> >> >> >> > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/cf_lists/message.cfm/forumid:4/messageid:246116 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4