>> This function will be executed fairly often so 
>> I want to reduce the overhead it creates.

 

I forgot to add the if this is a high traffic site and you want to reduce
going back to the Database on each page request then cache the query for
some length of time. We cache ours for two hours but you will have to tailor
it for the balance of performance, memory usage and timely information.  In
our case We have 10 of these types of queries on the home page for the
various categories.  Just use the following in your CFQuery statement.

 

<cfquery name="featuredfilesQry" datasource="#files.db#" dbtype="ODBC"
cachedwithin="#CreateTimespan(0,0,120,0)#">

 

 

 

 

Dennis,

Webmaster -  <http://www.halomaps.org> www.halomaps.org

.================================================.

|Halo Maps Website   -  <http://www.halomaps.org> http://www.halomaps.org
|

|Halo Movies Website -  <http://www.halomovies.org>
http://www.halomovies.org | 

|Halo CE Chronicles  - http://hcec.halomaps.org  |

.================================================.

 

From: [email protected] [mailto:[email protected]] On Behalf Of
Halo Maps
Sent: Monday, March 21, 2011 8:24 PM
To: [email protected]
Subject: RE: [OpenBD] Best way to randomize results from cfsearch collection

 

>> The more I think about it, I might just not use the catalog at all. 
>> This isn't a 'search' mechanism anyway, so I think I'm going to 
>> replan this and go to the db directly. 

 

We do something similar except it is to pull a list of video game map files
- pulling random recent ones - and the with MSSQL the query is something
like.

 

SELECT Top 10 ID,. <data fields>.

FROM thetable

Where  addeddate > #somedate#

Order By  NEW(ID)

 

 

Ordering by New(ID) randomizes the selection within the bounds of the Where
clause and the TOP X sets the limit of the records pulled.

 

 

 

Dennis,

Webmaster - www.halomaps.org

.================================================.

|Halo Maps Website   - http://www.halomaps.org   |

|Halo Movies Website - http://www.halomovies.org | 

|Halo CE Chronicles  - http://hcec.halomaps.org  |

.================================================.

 

-- 
official tag/function reference: http://openbd.org/manual/
mailing list - http://groups.google.com/group/openbd?hl=en

-- 
official tag/function reference: http://openbd.org/manual/
 mailing list - http://groups.google.com/group/openbd?hl=en

Reply via email to