Go Back   SitePoint Forums > Forum Index > Program Your Site > ColdFusion
Newsletter FAQ Members List Calendar Mark Forums Read

New to SitePoint Forums? Register here for free!

SitePoint Sponsor
 
Reply
 
Thread Tools Display Modes
Old Nov 7, 2009, 12:58   #1
r937
SQL Consultant
SitePoint Award Recipient
 
r937's Avatar
 
Join Date: Jul 2002
Location: Toronto, Canada
Posts: 30,279
Quote:
Originally Posted by cfStarlight View Post
Whenever a statement does _not_ explicitly state what it needs, the database has to do some extra steps (lookups) to figure out what you need.
it is a common misconception that this is less work

the database has to look up every column you type in, just to verify that it actually ~is~ a column in the table(s) you're referencing
Code:
SELECT cust_id
     , cust_name
     , yabba_dabba_ding_dong
     , cust_address 
  FROM customers
if anything, the dreaded, evil "select star" is actually marginally faster to parse...

... but has so many other drawbacks that it should never be used

(well, except in those cases when it doesn't have drawbacks, for example in EXISTS subqueries)
r937 is online now   Reply With Quote
Old Nov 7, 2009, 15:15   #2
cfStarlight
SitePoint Evangelist
 
Join Date: Mar 2007
Posts: 419
Quote:
the database has to look up every column you type in, just to verify that it actually ~is~ a column in the table(s) you're referencing
Of course it does, but the less information you give it .. the more looking it has to do. I hope you are not saying that retrieving _all_ column details is just as efficient as looking for specific columns. Cause if you are I'd like to see some docs on that. I'm happy to be proven wrong, but I want some docs to prove it ! ;-)
cfStarlight is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread | Next Thread »

Thread Tools
Display Modes

 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Sponsored Links
 
Forum Jump


All times are GMT -7. The time now is 04:04.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Copyright 1998-2009, SitePoint Pty Ltd. All Rights Reserved