Dave, thanks for the reply.  I won't bore you with details, but suffice it to 
say that we prefer getting empty recordsets back in some cases because it makes 
our overall error handling and application flow better--granted, perhaps to the 
detriment of application performance.  However, for us the trade-off has been 
well worth it to this point.

But, if the general consensus is that using <cfqueryparam> will really speed up 
execution in most cases, then perhaps we'll start using it.  

In the cases where it does increase performance, does it do so because SQL bind 
variables are used?

Thanks again,
Ben

>> the nice thing about this is that if "URL.userID" isn't an 
>> integer, int() returns 0, and the query executes and simply 
>> returns no records.  For us, this is a far preferable method 
>> than what cfqueryparam would do, which is to bomb before 
>> executing the query.
>
>You'd rather run a query unnecessarily than avoid running the query? Why not
>just catch the exception?
>
>> Then today I discovered that cfqueryparam supports bind 
>> variables, which theoretically will improve database 
>> performance.  So now the question is:  how much does it 
>> improve performance?  Am I really going to notice it?  
>
>In some cases, you'll see significant performance increases. In other cases,
>you won't. In still other cases, you may see performance degradation. All
>that said, I'd recommend that you use it in every case, because it will
>generally provide better performance in most cases.
>
>> Should I really switch my queries over to something like this:
>> 
>> SELECT username
>> FROM user
>> where userID = <cfqueryparam CFSQLType="CF_SQL_INTEGER" 
>> value=#int(URL.user_id)#>
>
>I would do without the Int part, myself, and just catch the appropriate
>exception. That's what exceptions are for!
>
>Dave Watts, CTO, Fig Leaf Software
>http://www.figleaf.com/
>
>Fig Leaf Software provides the highest caliber vendor-authorized
>instruction at our training centers in Washington DC, Atlanta,
>Chicago, Baltimore, Northern Virginia, or on-site at your location.
>Visit http://training.figleaf.com/ for more information!
>
>This email has been processed by SmoothZap - www.smoothwall.net 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
ColdFusion is delivering applications solutions at at top companies 
around the world in government.  Find out how and where now
http://www.adobe.com/cfusion/showcase/index.cfm?event=finder&productID=1522&loc=en_us

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:285970
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to