If your initial "Query" query was very complicated then using QoQ to
extract subsets would probably perform better.

 

-----Original Message-----
From: Billy Jamme [mailto:[EMAIL PROTECTED] 
Sent: Friday, 25 November 2005 4:16 p.m.
To: CF-Talk
Subject: Query of Queries (QoQ) performance question

Hi all,

I'm wondering if someone can explain to me how to properly utilize Query
of Queries (QoQ) to gain the maximum amount of performance.

Here's a code example.. 

<cfquery datasource="test" name="Query">
        Select ID, name
        From TempTable
</cfquery>

<cfset start = GetTickCount()>
<cfloop from="1" to="1000" index="i"
        <cfquery dbtype="query" name="QoQ">
                Select ID, Name
                From Query
                Where id = #i#
        </cfquery>
</cfloop>
<cfset end = GetTickCount()>
<cfset final = end - start>
QoQ result -<cfoutput>#final#</cfoutput><br>

<cfset start = GetTickCount()>
<cfloop from="1" to="1000" index="i"
        <cfquery datasource="test" name="QoQ">
                Select ID, Name
                From TempTable
                Where id = #i#
        </cfquery>
</cfloop>
<cfset end = GetTickCount()>
<cfset final = end - start>
Regular - <cfoutput>#final#</cfoutput>

When I run this I'm getting QoQ times 200-250% greater than the Regular
query.  I ran this on two machines, with similar results.  

Both machines were running CFMX 6.1 & MS-SQL 2000.  

I was under the impression that QoQ's were supposed to have better
performance than regular queries.  I am doing something wrong?

--j



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:225216
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to