Re: SQL Gurus... can this query be written more efficiently?

2010-06-18 Thread Tami Burke
>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 perf

RE: SQL Gurus... can this query be written more efficiently?

2010-06-18 Thread Che Vilnonis
bject: Re: SQL Gurus... 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

Re: SQL Gurus... can this query be written more efficiently?

2010-06-18 Thread Dave Watts
> 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/ http://training.fi

Re: SQL Gurus... can this query be written more efficiently?

2010-06-18 Thread Tami Burke
Why not perform your cflooping outside the SQL. This is much faster than forcing the query to manage the loop parsing and excution: trim(i) "> (you'll need to cleanup the 'and' and 'or' to consider that the first time it loops through to build the search crit

Re: SQL Gurus... can this query be written more efficiently?

2010-06-18 Thread Tami Burke
>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 >f

Re: SQL Gurus... can this query be written more efficiently?

2010-06-18 Thread Tami Burke
Why not perform your cflooping outside the SQL. This is much faster than forcing the query to manage the loop parsing and excution: trim(i) "> (you'll need to cleanup the 'and' and 'or' to consider that the first time it loops through to build the search crit

Re: SQL Gurus... can this query be written more efficiently?

2010-06-17 Thread Michael Grant
With either solution I hope you have good indexes. On Thu, Jun 17, 2010 at 5:42 PM, Carl Von Stetten wrote: > > Che, > > How about this: > > select searchterm, searchtype, numresults, timestamp > fromusersearch > where searchtype = cfsqltype="cf_sql_smallint"> >and numresults <>

Re: SQL Gurus... can this query be written more efficiently?

2010-06-17 Thread Carl Von Stetten
Che, How about this: select searchterm, searchtype, numresults, timestamp fromusersearch where searchtype = and numresults <> searchterm like or ) and searchterm NOT IN () ) order by searchtermcount desc Also, I don't think you need the on the

SQL Gurus... can this query be written more efficiently?

2010-06-17 Thread Che Vilnonis
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