[Edit: Edited based on Leigh's suggestions
I consistently have an issue with where using
column like <cfqueryparam cfsqltype="cf_sql_varchar" value="abc%" />
is slower than by about 30ms.
column like 'abc%'
Before the plan is cached, both queries run at about the same time ~60ms. Subsequent hits result in 1ms for the query without cfqueryparam and 30ms for the one using cfqueryparam. The DSN is sending unicode and the column type is nvarchar. I don't notice this behaivor with "=", just the LIKE operator. This particular column is not indexed.
Does anyone know why this behavior happens?