Okay, Then... As a best practice(?) start by assuming that you're DB will process your where clauses from the bottom up and help the system out. If you're lucky enough to have the best stuff out there, like Oracle, which I assume atleast 85%, probably more, don't have then just code completely free of any form knowing that your DB will make up for it.
If Oracle is optimizing now, then I bet MS SQL server is right on there heels and either doing it too, or have it planned in some service pack. That still leaves Access, PostgreSQL and mySQL. I bet they'd like the help of a well planned SQL statement. Cheers, t ********************************************************************** Tyler M. Fitch Certified Advanced ColdFusion 5 Developer ISITE Design, Inc. 615 SW Broadway Ste. 200 Portland, OR 97205 503.221.9860 ext. 111 http://isitedesign.com ********************************************************************** -----Original Message----- From: Dave Carabetta [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 14, 2002 9:40 AM To: CF-Talk Subject: RE: cfqueryparam - order of where/and >Actually, > >The where clause processes bottom up. > >So, if possible, for best results place your most restricting clauses >LAST and filter out the greatest amount of data. Then the next where >clause up from the bottom has the least amount of records possible to >compare against and will perform faster. > I would be careful about making a blanket statement like that. Oracle doesn't care how you pass it in because its Explain Plan is going to map out the best way to execute the query, regardless of the order in which you pass it in. Oracle has specifically focused on this (among other things) in its last few releases to optimize performance. Hence its claims that it's the fastest DB in the world (and unbreakable). I can't speak knowledgeably about SQL Server, but I just wanted to point out that making a blanket statement can potentially be misleading to people with less experience. Regards, Dave. _________________________________________________________________ Join the world's largest e-mail service with MSN Hotmail. http://www.hotmail.com ______________________________________________________________________ Get Your Own Dedicated Windows 2000 Server PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER Instant Activation � $99/Month � Free Setup http://www.pennyhost.com/redirect.cfm?adcode=coldfusionb FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/[email protected]/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

