Re: Select * in SQL

2006-07-12 Thread Robertson-Ravo, Neil (RX)
Message- From: Leon Oosterwijk [EMAIL PROTECTED] To: CF-Talk cf-talk@houseoffusion.com Sent: Tue Jul 11 21:58:13 2006 Subject: RE: Select * in SQL All, Let me be the devil's advocate and say that I prefer * despite all the arguments made against it. To me, hand-coding the column names before

Re: Select * in SQL

2006-07-12 Thread Will Tomlinson
It should be in her download here: CFUnited 2006 Writing Efficient SQL http://www.webtricks.com/pres.cfm Then some notes on the preso here: http://www.talkingtree.com/blog/index.cfm?mode=entryentry=CDA25D0A-50DA-0559-A0104C817FCAD1E8 Will

Re: Select * in SQL

2006-07-12 Thread Will Tomlinson
I think this was one of her tests... it was on a downloadable USDA database I think. DECLARE @Start DATETIME, @End DATETIME, @Total1 BIGINT, @Total2 BIGINT, @Total3 BIGINT, @LoopCount INT, @LoopTotal

Re: Select * in SQL

2006-07-12 Thread Jim
Any idea why she wrote her own efficiency monitor stuff instead of using query analyzer? Will Tomlinson wrote: I think this was one of her tests... it was on a downloadable USDA database I think. DECLARE @Start DATETIME, @End DATETIME, @Total1 BIGINT,

Re: Select * in SQL

2006-07-12 Thread Will Tomlinson
Any idea why she wrote her own efficiency monitor stuff instead of using query analyzer? Heck I dunno. Will ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by

Re: Select * in SQL

2006-07-12 Thread Claude Schneegans
Just wondering what DB According to the examples given in the preso for joins, it looks like it is an Oracle DB. -- ___ REUSE CODE! Use custom tags; See http://www.contentbox.com/claude/customtags/tagstore.cfm (Please send any spam to this address: [EMAIL

Select * in SQL

2006-07-11 Thread Ryan, Terrence
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

Re: Select * in SQL

2006-07-11 Thread Charlie Griefer
a few seconds more to type out...but I'm typing it out once. I'm referring back to it frequently :) On 7/11/06, Ryan, Terrence [EMAIL PROTECTED] 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

Re: Select * in SQL

2006-07-11 Thread Rey Bango
... 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

Re: Select * in SQL

2006-07-11 Thread Crow T. Robot
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

RE: Select * in SQL

2006-07-11 Thread Andy Matthews
PROTECTED] 615.370.1530 x737 --//- -Original Message- From: Ryan, Terrence [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 11, 2006 10:05 AM To: CF-Talk Subject: Select * in SQL I have a dumb question. Can someone point me to a definitive explanation of why select * in SQL

Re: Select * in SQL

2006-07-11 Thread Robyn
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

RE: Select * in SQL

2006-07-11 Thread Dave Watts
I have a dumb question. Can someone point me to a definitive explanation of why select * in SQL is bad? There are various performance-related reasons, none of which is that strong in my opinion. However, it's generally bad to introduce unnecessary ambiguity, which is what * does. Are you using

RE: Select * in SQL

2006-07-11 Thread Ben Nadel
, that never happens. ... Ben Nadel www.bennadel.com -Original Message- From: Ryan, Terrence [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 11, 2006 11:05 AM To: CF-Talk Subject: Select * in SQL I have a dumb question. Can someone point me to a definitive explanation of why

Re: Select * in SQL

2006-07-11 Thread Charlie Griefer
On 7/11/06, Andy Matthews [EMAIL PROTECTED] wrote: If you actually need every one of the columns in a single (or multiple) row(s) then select * saves time. Isn't that we all try to do, save ourselves time? Why not in this case? because it doesn't save time in the long run when you're trying to

Re: Select * in SQL

2006-07-11 Thread Claude Schneegans
I have a dumb question. Can someone point me to a definitive explanation of why select * in SQL is bad? SELECT * is not bad if you need ALL columns. If you only need a subset of columns in a table, it is better to list them explicitely, otherwise the query will unefficiently return unused data

Re: Select * in SQL

2006-07-11 Thread Deanna Schneider
The best reason that I've found in working with CF is that CF or the driver sometimes does a weird caching thing and if you make a change in the underlying table, they won't pick it up. When that happens, it doesn't save you any time, as you'll spend extra time trying to figure out why what once

Re: Select * in SQL

2006-07-11 Thread Claude Schneegans
1) You're pulling back every row in the specific table Read Every column ;-/ 3) You're not leveraging any of the indexing capabilities of the table ??? How come? Any available index can still be used depending on the WHERE and ORDER BY clauses. -- ___

Re: Select * in SQL

2006-07-11 Thread Claude Schneegans
When you use *, the database has to do a lookup to figure out what the actual column names are in the table, then do the actual select statement. If you explicitly tell it what column names (even if you want all of them), you eliminate that overhead. I don't agree with this argument: 1) any

RE: Select * in SQL

2006-07-11 Thread Ryan, Terrence
: Tuesday, July 11, 2006 11:05 AM To: CF-Talk Subject: Select * in SQL 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

Re: Select * in SQL

2006-07-11 Thread Claude Schneegans
because it doesn't save time in the long run when you're trying to maintain or debug your code down the road and you find yourself wondering which columns specifically are coming back from the query. Well, this is only when you are wondering which columns specifically are coming back from the

Re: Select * in SQL

2006-07-11 Thread Jim
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

RE: Select * in SQL

2006-07-11 Thread Andy Matthews
- From: Charlie Griefer [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 11, 2006 10:24 AM To: CF-Talk Subject: Re: Select * in SQL On 7/11/06, Andy Matthews [EMAIL PROTECTED] wrote: If you actually need every one of the columns in a single (or multiple) row(s) then select * saves time. Isn't that we

Re: Select * in SQL

2006-07-11 Thread Charlie Griefer
On 7/11/06, Claude Schneegans [EMAIL PROTECTED] wrote: because it doesn't save time in the long run when you're trying to maintain or debug your code down the road and you find yourself wondering which columns specifically are coming back from the query. Well, this is only when you are

RE: Select * in SQL

2006-07-11 Thread Dawson, Michael
for Jochem to give the final answer on this... M!ke -Original Message- From: Jim [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 11, 2006 10:39 AM To: CF-Talk Subject: Re: Select * in SQL Heres a real world scenario I've come across: Code throughout the app is using data returned from

Re: Select * in SQL

2006-07-11 Thread Robertson-Ravo, Neil (RX)
- From: Dawson, Michael [EMAIL PROTECTED] To: CF-Talk cf-talk@houseoffusion.com Sent: Tue Jul 11 17:03:20 2006 Subject: RE: Select * in SQL A well-written driver would then throw an ambiguous column name error, if that happens. First, you would need to create a table alias: SELECT t1.* FROM

RE: Select * in SQL

2006-07-11 Thread Andy Matthews
Message- From: Jim [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 11, 2006 10:39 AM To: CF-Talk Subject: Re: Select * in SQL 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

Re: Select * in SQL

2006-07-11 Thread Nick de Voil
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

Re: Select * in SQL

2006-07-11 Thread Claude Schneegans
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. If you're working in an environment in which any one can add columns or modify a table without othe programers being aware, then you will have have many more

Re: Select * in SQL

2006-07-11 Thread Claude Schneegans
Seems to me that it would save time to not have to look to another development tool to get the information. Depends which tool. Mine will generate a complete CFQUERY tag with all table and column names just by clicking on them. But I had to develop it myself ;-) --

Re: Select * in SQL

2006-07-11 Thread Robertson-Ravo, Neil (RX)
PROTECTED] To: CF-Talk cf-talk@houseoffusion.com Sent: Tue Jul 11 17:14:21 2006 Subject: Re: Select * in SQL 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

Re: Select * in SQL

2006-07-11 Thread Jim
Oh yes, when you go out to troubleshoot other companies apps you certainly do come across many more problems. Not a good example of where explicit alias + naming would have been handy? OK, sorry bout that. Claude Schneegans wrote: Someone adds a column to one of the tables in the query that

Re: Select * in SQL

2006-07-11 Thread Casey Dougall
Select * is for whimps, where they write a couple basic sql statements. select with column names is for the cool kids in town where we'd rather write it in SQL vs writing all those *Arrays, Structures, Multidimensional Arrays Arrays of Structures***. That's a slight crack on Kurtis D

Re: Select * in SQL

2006-07-11 Thread Gert Franz
our Mailing List / Treten Sie unserer Mailingliste bei: deutsch: http://de.groups.yahoo.com/group/railo/ english: http://groups.yahoo.com/group/railo_talk/ Ryan, Terrence schrieb: I have a dumb question. Can someone point me to a definitive explanation of why select * in SQL is bad? I've

Re: Select * in SQL

2006-07-11 Thread Rick Root
Ryan, Terrence wrote: I have a dumb question. Can someone point me to a definitive explanation of why select * in SQL is bad? #1 - if you provide column names, Coldfusion doesn't have to figure them out. #2 - If you don't need all the columns, don't retrieve them all. It can dramatically

Re: Select * in SQL

2006-07-11 Thread Robertson-Ravo, Neil (RX)
Message- From: Gert Franz [EMAIL PROTECTED] To: CF-Talk cf-talk@houseoffusion.com Sent: Tue Jul 11 17:59:25 2006 Subject: Re: Select * in SQL Hi Ryan, there are many reasons why you shouldn't pull data with Select * 1. You have some overhead for the database to create the List of the columns

Re: Select * in SQL

2006-07-11 Thread Claude Schneegans
1. You have some overhead for the database to create the List of the columns to retrieve IMHO this is a wrong argument: it is definitely easier for the driver to take the list of columns as it is defined in the datasource, than to read yours and compare with the list in the datasource to check

Re: Select * in SQL

2006-07-11 Thread Will Tomlinson
Selene Bainum did a SQL preso at CFUNITED and demo'd the asterisk VS. listing each column. Then she showed the performance differences. The asterisk was WAY slower than listing each column. Will ~| Introducing the Fusion

Re: Select * in SQL

2006-07-11 Thread Crow T. Robot
Heh - I was referencing that same preso. Even looked it up to make sure I had the right example. Will Tomlinson wrote: Selene Bainum did a SQL preso at CFUNITED and demo'd the asterisk VS. listing each column. Then she showed the performance differences. The asterisk was WAY slower than

RE: Select * in SQL

2006-07-11 Thread Dave Watts
IMHO this is a wrong argument: it is definitely easier for the driver to take the list of columns as it is defined in the datasource, than to read yours and compare with the list in the datasource to check if they are legal column names. Well, if you take a look at what your database

RE: Select * in SQL

2006-07-11 Thread Leon Oosterwijk
Subject: Re: Select * in SQL Heh - I was referencing that same preso. Even looked it up to make sure I had the right example. Will Tomlinson wrote: Selene Bainum did a SQL preso at CFUNITED and demo'd the asterisk VS. listing each column. Then she showed the performance differences. The asterisk