Thanks for jumping in, Sharon.  Good suggestions.

In just a few minutes mulling over your ideas, I've
come up with some possibilities.

My app is a Yellow Pages.

So one query I have been running is to list all
Headings that start with "A" for example
(Academies, Access Control Systems, Accessories-Fashion,
and so forth...)

So your approach would be to load all Headings that begin
with A into a structure, all those that begin with B
into another structure, and so forth.  Right?  This
eliminates a call to the DB.

Another would be to load all Listings in one city, say
New York into a structure, all Listings in Newark into
another structure, and so forth.

Is this the idea?  Do you have any specific suggestions
for Yellow Pages?

best,  paul


At 09:18 PM 9/1/00 -0400, you wrote:
>OK, gonna jump in on this one now.
>
>I don't use cached queries.  I use scoped queries.  Essentially the same
>thing, but I like managing my own caching rather than allowing the server
>to determine what gets cached (based on the rotating list of "last used").
>Just a preference.
>
>But on the queries vs. structures discussion you're comparing apples and
>oranges.  If you have data that you're going to loop over and output, use a
>query.  That's what they're designed for.  But if you're going to call
>individual pieces of data (particularly organizationally nested pieces of
>data) than use a structure, much quicker to point to exactly what you want
>than to loop to find it.
>
>Example, a structure that holds school information:
>
>schools.schoolname.class.teacher = "[teachername]"
>
>In my code (where I know the school and class):
>#schools[schoolname][class]["teacher"]# will output teacher name.
>
>I can pull this information out of a resident structure much quicker than
>running a query, or even looping through a query to find the information I
>want.  This may not be the best example, but it may help to look at some of
>the queries you're running to get complex information and see where a
>nested structure (queried for and built once) saved into application scope
>(then copied to request scope with cflock for usage) might be a better
>alternative.
>
>I *love* structures and I'm open to any questions on using them efficiently.
>
>Sharon
>
>P.S., <cfscript> rules for working with structures, whether it's faster or 
>not.
>
>------------------------------------------------------------------------------
>Archives: http://www.mail-archive.com/[email protected]/
>To Unsubscribe visit 
>http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or 
>send a message to [EMAIL PROTECTED] with 'unsubscribe' in 
>the body.

------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to