Re: cfquery results - related question

2013-01-07 Thread Russ Michaels

list of towns is not really a huge query, just do it once and cache and
then do a query of query for your auto complete.


On Mon, Jan 7, 2013 at 2:06 PM, Stephens, Larry V  wrote:

>
> A related question: I have a table of towns that has ~20,000 records. The
> dataset I need has the record ID, town name, a memo field (usually empty),
> and fields holding an index into other tables (township, county, state,
> country). In my form I have a select field to pick the town. I don't want
> to populate that with 20,000 options so I have a way for the user to pare
> down the possibilities based on the first letter of the town name. I then
> make an ajax call and use jquery/javascript to populate the select field
> options.
>
> Which is better: run a query of the table at the top of the application
> and store the results in an APPLICATION variable, then do a query of
> queries for each subset, or just query the table directly for each subset?
>
> My initial thinking is the former but now I'm wondering. I do know the
> first option runs quickly, returning about 300 records for "M" and
> populating the select field in 1-2 seconds (I haven't actually timed it,
> and that's lightning fast for most users of the app).
>
> Larry Stephens
>
> 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:353796
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


RE: cfquery results - related question

2013-01-07 Thread Stephens, Larry V

A related question: I have a table of towns that has ~20,000 records. The 
dataset I need has the record ID, town name, a memo field (usually empty), and 
fields holding an index into other tables (township, county, state, country). 
In my form I have a select field to pick the town. I don't want to populate 
that with 20,000 options so I have a way for the user to pare down the 
possibilities based on the first letter of the town name. I then make an ajax 
call and use jquery/javascript to populate the select field options.

Which is better: run a query of the table at the top of the application and 
store the results in an APPLICATION variable, then do a query of queries for 
each subset, or just query the table directly for each subset?

My initial thinking is the former but now I'm wondering. I do know the first 
option runs quickly, returning about 300 records for "M" and populating the 
select field in 1-2 seconds (I haven't actually timed it, and that's lightning 
fast for most users of the app).

Larry Stephens

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:353795
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm