Slow query with cfqueryparam searching on indexed column containing hashes

后端 未结 3 423
北海茫月
北海茫月 2020-12-04 02:27

I have the following query that runs in 16ms - 30ms.


    SELECT hash FROM jobs WHERE hash in(
           


        
3条回答
  •  生来不讨喜
    2020-12-04 03:04

    Your issue may be related to VARCHAR vs NVARCHAR. These 2 links may help Querying MS SQL Server G/UUIDs from ColdFusion and nvarchar vs. varchar in SQL Server, BEWARE

    What might be happening is there is a setting in ColdFusion administrator if cfqueryparam sends varchars as unicode or not. If that setting does not match the column setting (in your case, if that setting is enabled) then MS SQL will not use that index.

提交回复
热议问题