Cedric Villat wrote:
> I'm doing a query like this:
> 
> <cfquery name="updateTicket" datasource="#request.dsn#"
> username="#request.dbuser#" password="#request.dbpass#">
>   UPDATE Tickets
>   SET  folder = <cfqueryparam cfsqltype="CF_SQL_INTEGER"
> value="#getEscalationInfo.eFolder#">,
>     dateUpdated = <cfqueryparam cfsqltype="CF_SQL_TIMESTAMP"
> value="#CreateODBCDateTime(Now())#">
>   WHERE ticketID IN (<cfqueryparam cfsqltype="CF_SQL_VARCHAR"
> value="#tickList#" list="Yes">)
>  </cfquery>
> 
> The tickList can contain 20-30,000+ items, and performing this query takes
> forever. What can I do to improve this a bit more? Perhaps doing multiple
> updates within the <cfquery> or doing ticketID = #List[1]# OR ticketIS =
> #List[2]# etc? Any ideas?

I don't think that the translation to ... OR .... is going to help, most 
databases do that internal anyway. Best would be if you got the ticklist 
from the same database, then you could just use a join.

Jochem

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm

Reply via email to