If your method is only going to get called a hundred times per day, I
wouldn't worry about caching too much, it's not going to have much
efffect if your lookup queries are simple (which they should be).

If you want to optimize, a better route would probably to read the
lookup table once when you instantiate the CFC, and then move the data
into a struct, and then use that through your methods.  Structs are
hella fast for doing lookup operations, because they were
purpose-built for the job.  If the lookup table is going to change
frequently, then you probably need to expose a way to reload the
cached data periodically (or on command), or even just reinitialize
the CFC.

cheers,
barneyb


On Mon, 17 Jan 2005 15:53:20 -0500, sonicDivx <[EMAIL PROTECTED]> wrote:
> I have a CFC that has a function that builds a query statement dynamically.
> Part of the specific function loops over the data passed and sets the values.
> 
> In doing so it checks to see if data if of a specific type. Part of
> that check involves looking at a property table defined like so;
>         fieldname   |    fieldtype
>          myfield      |    varchar2
> 
> My question is having CF make constant calls to this lookup query is
> that going to have a significant impact on performance?  On average
> the dynamic query will have to loop over about  10 -20 fields, thus
> calling the lookup that many times. Also the function itself may be
> call 10s of times a day possibly even in the hundreds.
> 
> My though is to Cache the lookup query so each result set is cached.
> Eventually the lookup may get moved into Oracle just not right now.
> 
> Does that seem reasonable or does someone have a better suggestion for
> performing the lookup to get datatype (maybe query or query solution).
> 
> thanks.
> 

-- 
Barney Boisvert
[EMAIL PROTECTED]
360.319.6145
http://www.barneyb.com/

Got Gmail? I have 8 invites.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Discover CFTicket - The leading ColdFusion Help Desk and Trouble 
Ticket application

http://www.houseoffusion.com/banners/view.cfm?bannerid=48

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:190829
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