Thanks all. In the end, Carl's idea to use "NOT IN" and Micheal's reminder to use SQL indexes allowed me to drop a good 1 to 1.5 seconds. Cool beans!
-----Original Message----- From: Dave Watts [mailto:[email protected]] Sent: Friday, June 18, 2010 12:26 PM To: cf-talk Subject: Re: SQL Gurus... can this query be written more efficiently? > Why not perform your cflooping outside the SQL. This is much faster > than forcing the query to manage the loop parsing and excution: Building the loop in or out of the CFQUERY tag makes no difference in performance. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:334657 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

