Hi Josian,
My philosophy is to let the software do the work for you. In this case,
that means letting CF cache the query for you. It's pretty good at it, it
will get better at it with new releases, and it's not something that you
should need to be doing "manually". If all you ever want to do is loop
through the recordset, then just leave the query alone, and CF will do the
work for you.
On the other hand, if it's more convenient for you to be able to reference
the data in a different form, like as an associative array for random
access, then that's an entirely different matter.
So in summary: Let database servers and ColdFusion do what they are good at,
ie deliver and cache recordsets as efficiently as is possible. But if you
want to transform the data into a more useful format, then go ahead and use
whatever structures are most appropriate.
Have fun,
LeeBB
>From: "josian" <[EMAIL PROTECTED]>
....
>
>I have a pb to cache a query or put it in an application variable(for a
>query which rarely changes).
>So what is the best choice?
>Does CF Server treat the two in the same way or store them differently?
>Below is a piece of my code...
>
>
>Cached query...
>
><CFQUERY NAME="myquery" DATASOURCE="data"
>cachedwithin="#createtimespan(365)#>
>SELECT NAME,PARENT,PATH
>FROM FAMILY
></CFQUERY>
>
>
>Set query in application variable....
>
><CFQUERY NAME="application.myquery" DATASOURCE="data">
>SELECT NAME,PARENT,PATH
>FROM FAMILY
></CFQUERY>
....
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists