Tally List : mailing list management, archiving, and analysis
click for archive home
 
Archive of:
CF-Talk
Cold Fusion - Technical
 
home
24 hour view
quick stats
weekly updates
 
all tallylists
corporate solutions
archive your favorite
help / feedback


Search the Tallylist search by keyword:

About Cold Fusion :
product's home
product's list home
 
  Archived TallyList / CF-Talk: 
Subject: RE: SELECT * Queries
Philip Arnold - ASP (661p/+0r)     Posted: Monday 02 Apr 2001
This post: 53 views, +0 rating

> Hi all. I've always been told, and read here that using * in SELECT > queries is slower than specifying the field names. I just happen to > be working on a site now where I have a page with 3 big SELECT > queries. One of them with over 100 fields. If I use * in lieu of the > field names, the page execution time is reduced from +- 250 > milliseconds to +- 185 milliseconds, with the actual query times > being cut by about 1/3. > > Anyone else experience this? The 2 largest queries have no joins, but > even the one with a join goes from 50 ms to 35 ms if I use: > SELECT L.*,B.* > > Have I been reading this wrong? I've sure wasted alot of time > entering field names into Select queries , not to mention slowing > down my apps.

This is all dependant on the database engine you use, but here's why you shouldn't normally use "SELECT * FROM"

When you do SELECT * the database has to go to the "system" table and find the list of fields in that table, then effectively do a "SELECT field1, field2, field3" for you - this is increasing the access time in the database as it has to do an additional query for you

If you only want a couple of the fields, then it's a complete waste to get all field, although it can be advantagous doing a "SELECT *" as there's less info going to the SQL engine for the request for it to parse, which can be slower than the query speed itself...

Philip Arnold Director Certified ColdFusion Developer ASP Multimedia Limited T: +44 (0)20 8680 1133

"Websites for the real world"

********************************************************************** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. **********************************************************************


Similar Subject Line Posts (+/- two weeks of this post)
RE: SELECT * Queries  02 Apr 2001 (this post)   (53 v/ +0 r)
RE: SELECT * Queries  31 Mar 2001   (162 v/ +0 r)
RE: SELECT * Queries  31 Mar 2001   (57 v/ +0 r)
RE: SELECT * Queries  31 Mar 2001   (67 v/ +0 r)
RE: SELECT * Queries  31 Mar 2001   (52 v/ +0 r)
RE: SELECT * Queries  31 Mar 2001   (40 v/ +0 r)
Re: SELECT * Queries  31 Mar 2001   (40 v/ +0 r)
SELECT * Queries  31 Mar 2001   (61 v/ +0 r)
 

Send a reply to the CF-Talk list!
click to send a reply! NOTE: Many lists will reject your post unless you have already registered with them. Also - don't forget the right account to send from (for those with multiple emails!)

Feedback: If this post was exceptionally helpful, please help by giving this post a positive review.

 

TallyList : copyright Ububik - 2000