By the time the cfquery tag has finished executing the entire data set has been returned from the database and is loaded into memory in ColdFusion.
If the cfquery tag is taking a very long time to complete then: 1) The actual SQL is taking a long time to complete. 2) and/or you are returning a very large amount of data to the ColdFusion server 3) and/or you have very slow connection between your SQL server and your CF server. 302 thousands records is quite a bit-- especially if you have a memo field in there. Can you even add indexes in Access? If so, you might want to consider it. If you just want a count, then just do select count(1) and only a single record has to pass from your database to CF. There are a number of reasons why running the select directly in Access may appear much faster. 1) You are probably running it locally so there is no costly transfer of data between servers. 2) In my experience, Access spools the data behind the scenes and only loads in the records which are visible on the screen which gives your query a very fast turn-around and then it lazy-loads the data in as your scroll down. ~Brad ----- Original Message ----- From: "Claude Schneegans" <[email protected]> To: "cf-talk" <[email protected]> Sent: Sunday, March 08, 2009 5:42 PM Subject: What the heck is happening during CFQUERY? > > Hi, > > I've always thought that all what CFQUERY was doing was to create some > connection to the database, and then the actual content of all records > would be read as needed during some loop on the result set. > > I have this statement on some Access database : > <CFQUERY NAME="getArmes" DATASOURCE="Armoriaux"> > SELECT armeId, armTexte > FROM armesArmoriaux > </CFQUERY> > <CFOUTPUT>getArmes.recordCount = #getArmes.recordCount#<BR> > cfquery.ExecutionTime = #cfquery.ExecutionTime#<BR></CFOUTPUT><CFABORT> > > The query semms to take for ever. Actually, the output says: > getArmes.recordCount = 303203 > cfquery.ExecutionTime = 614469 > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:320242 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

