It's not just 'network latency' but overall CF-SQL Server latency. We have both running on our dev box where I did the tests so there is no network latency, and combining 3 simple queries into 1 cost about 40% of the time of running the 3 in a row.
On a side note, this also proved true when I tested it with query caching although I would assume this just has to do with the overhead from cache lookup. Admitedly, if you have a bunch of sql statements with no processing you should consider putting them in a stored procedure. As this has gotten off topic though, I'll go ahead and request that you email me directly if you know how to retrieve the data as I'd still appreciate knowing. Thanks, -Lyle > You just answered the question I had in mind. > >> It's not like each cfquery call is a separate > open-execute-close connection to the database. > > If it's not so then why would this run faster as opposed to >putting CFQUERY inside a loop? > > >> insert into footable ( bar1, bar2) > >> select '#bar1[1]#', '#bar2[1]' > >> union all > >> select '#bar1[2]#', '#bar2[2]' > >> union all > >> select '#bar1[3]#', '#bar2[3]' > >> ....... > > -----Original Message----- > From: Dave Carabetta [mailto:[EMAIL PROTECTED] > Sent: Wednesday, May 12, 2004 7:50 AM > To: [EMAIL PROTECTED] > Subject: RE: [CFCDev] OT: Using JDBC instead of <cfquery> in >CFC's > > > >Along the same line, what is the best way to retrieve data from > > >multiple > >queries in a cfquery? > > > >In procedures you use cfprocresult, but I haven't found >anything in the > >documentation to > >hint at how one would get the data from the second query in >this: > > > ><cfquery name="TopicInfo" datasource="dslkf"> > > SELECT Description > > FROM Vocab > > WHERE Display=1 AND Type='GS' > > ORDER BY DisplayOrder; > > > > SELECT Name > > FROM VAggregates > > WHERE Display=1 AND Type IN ('Teacher','Student') > > ORDER BY Name; > ></cfquery> > > > > Not sure why you'd really need to do that. Since CF pools >database > connections, there is virtually no overhead whatsoever to using >separate > cfquery calls for each query. It's not like each cfquery call is >a separate > open-execute-close connection to the database. > > Regards, > Dave. > > > ---------------------------------------------------------- > You are subscribed to cfcdev. To unsubscribe, send an email > to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev' > in the message of the email. > > CFCDev is run by CFCZone (www.cfczone.org) and supported > by Mindtool, Corporation (www.mindtool.com). > > An archive of the CFCDev list is available at >www.mail-archive.com/[EMAIL PROTECTED] > > ---- > This email may contain confidential and privileged material for >the sole use of the intended recipient(s). Any review, use, distribution >or disclosure by others is strictly prohibited. If you are not the >intended recipient (or authorized to receive for the recipient), please >contact the sender by reply email and delete all copies of this message. > > To reply to our email administrator directly, send an email to > [EMAIL PROTECTED] > > Littler Mendelson, P.C. > http://www.littler.com > > > > ---------------------------------------------------------- You are subscribed to cfcdev. To unsubscribe, send an email to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev' in the message of the email. CFCDev is run by CFCZone (www.cfczone.org) and supported by Mindtool, Corporation (www.mindtool.com). An archive of the CFCDev list is available at www.mail-archive.com/[EMAIL PROTECTED]
