In general, the more complex the query (multi table joins, subqueries, that sort of thing), the more complex the execution plan, and the greater performance benefit from having that execution plan cached. You also want to factor in how often the query is executed as well since a cached execution plan is only of benefit if that cache is used (and the caching is not indefinite).
Really though, performance isn't the only, or necessarily primary, reason to use cfqueryparam. My approach (and one that you will find is common) is to use it always, unless there is a particularly compelling reason NOT to (aside from being lazy about the extra typing ;) ) The only common reason to NOT use it, prior to CF8, was that you can't use cachedwithin on the query if it uses cfqueryparam. Aside from that, it's more a question of WHY NOT use it, rather than WHY use it. On 8/10/07, Ben Mueller <[EMAIL PROTECTED]> wrote: > > Okay, now I need to do some homework. Are there resources anywhere that > can help tell me what queries would benefit from such things? My knowledge > of SQL is decent, but isn't quite *that* deep. I would think all queries > would benefit from that. > > Ben > > > >> Am I going to see a significant performance increase? For > >> the sake of argument, pretend that sample query I included in > >> my first post is heavily hit. I'm running SQL Server 2000 > >> (soon to upgrade to 2005). > > > >The answer will depend on whether that particular query benefits from a > >generic, reusable execution plan. > > > >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 > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Get the answers you are looking for on the ColdFusion Labs Forum direct from active programmers and developers. http://www.adobe.com/cfusion/webforums/forum/categories.cfm?forumid-72&catid=648 Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:285980 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

