SELECT DISTINCT Table3.ID
FROM Table1
INNER JOIN Table2 ON Table1.thisID = Table2.thisID
INNER JOIN Table3 ON Table2.ID = Table3.ID
WHERE ( Table1.ID IN
(
<cfqueryparam cfsqltype="cf_sql_integer"
value="#idlist#" list="yes">
)
)
AND Table2.ID IN
(
<cfqueryparam cfsqltype="cf_sql_integer"
value="#idlist2#" list="yes">
)
AND Table3.active=1
ORDER BY Table3.ID
When I run the above code it takes 11 to 15 seconds. If I remove the cfqueryparam, and just use the idlist2
variable, the query only takes 32 milliseconds.
Is this an issue with cfqueryparam, or am I doing something incorrect?