Why not perform your cflooping outside the SQL. This is much faster than
forcing the query to manage the loop parsing and excution:
cfset xsearch = ''
cfloop list='#theModels#' index='i'
cfset xsearch = xsearchor searchterm like '%#i#%'
/cfloop
cfif listlen(
Take the following query. Is there a more efficient way to handle the where
clause? Specifically, the last two 'and' statements that loop through two
different lists, one that includes results and one that excludes results.
Thanks, Che
select searchterm, searchtype, numresults, timestamp
from
Why not perform your cflooping outside the SQL. This is much faster than
forcing the query to manage the loop parsing and excution:
cfset xsearch = ''
cfloop list='#theModels#' index='i'
cfset xsearch = xsearchor searchterm like '%#i#%'
/cfloop
cfif listlen(
Why not perform your cflooping outside the SQL. This is much faster than
forcing the query to manage the loop parsing and excution:
Building the loop in or out of the CFQUERY tag makes no difference in
performance.
Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
... can this query be written more efficiently?
Why not perform your cflooping outside the SQL. This is much faster
than forcing the query to manage the loop parsing and excution:
Building the loop in or out of the CFQUERY tag makes no difference in
performance
Building the loop in or out of the CFQUERY tag makes no difference in
performance.
My experience is that performance can be impacted slightly based on number of
users, number of terms, and complexity of the query as a result of the
parameters to be evaluated. We have found better overall
Che,
How about this:
select searchterm, searchtype, numresults, timestamp
fromusersearch
where searchtype = cfqueryparam value=#arguments.searchtype#
cfsqltype=cf_sql_smallint
and numresults cfqueryparam value=0
cfsqltype=cf_sql_smallint
cfloop index=i
With either solution I hope you have good indexes.
On Thu, Jun 17, 2010 at 5:42 PM, Carl Von Stetten cmvon...@hotmail.comwrote:
Che,
How about this:
select searchterm, searchtype, numresults, timestamp
fromusersearch
where searchtype = cfqueryparam value=#arguments.searchtype#
8 matches
Mail list logo