Consider the following:
<cfquery name="aQuery" datasource="#aSource#">
SELECT aColumn
FROM aTable
WHERE bColumn = <cfqueryparam value="#aVariable#" cfsqltype="#aSqlType#" />
AND cColumn = 'someConstant'
AND dColumn is null
</cfquery>
If I change
AND cColumn = 'someConstant'
to
AND cColumn = <cfqueryparam value="someConstant" cfsqltype="#aSqlType#" />
Is there a potential performance improvement? Is there potential to hurt performance?
What if I do the same (use cfqueryparam) with AND dColumn is null
?
My findings have been inconclusive.
If it's important, assume ColdFusion9 and Oracle db 11g.
EDIT:
I'd just like to reiterate that I'm asking about cfqueryparam tags being used specifically with constants and/or null values and the performance remifications, if any.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…