At 10:42 AM 01/21/2002 +0800, you wrote: > > <CFQuery = "q_results> > > SELECT Top 1 * FROM T_EMAIL > > ORDER BY Eid DESC > > </CFQUERY> > >Assuming this has the same output as: > ><cfquery query="q_results" maxrows="1"> >select * from t_email >order by eid desc ></cfquery> > >Will the former example yield less load from the DB server than the latter?
It depends. In most cases I would say yes. The example at the top will only return 1 row from the result set. The bottom one will return all rows, but ColdFusion will only create a query object with 1 element in it. If you have a table with 1 row in it, I would expect the difference to be negible if any. If you have a table with ten thousand rows in it, then would you rather return ten thousand rows to ColdFusion, and use only one of them? Or would you rather return 1 row to ColdFusion, and use that one? -- Jeffry Houser | mailto:[EMAIL PROTECTED] AIM: Reboog711 | ICQ: 5246969 | Fax / Phone: 860-223-7946 -- DotComIt: Database Driven Web Data My Book: Instant ColdFusion 5 | http://www.instantcoldfusion.com My New Book: ColdFusion: A Beginner's Guide February 2002 -- Far Cry Fly, Alternative Folk Rock http://www.farcryfly.com | http://www.mp3.com/FarCryFly ______________________________________________________________________ Why Share? Dedicated Win 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=coldfusionc 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

