Slow query with cfqueryparam searching on indexed column containing hashes

后端 未结 3 424
北海茫月
北海茫月 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:05

    I don't think cfqueryparam causing issue. As you have mention big hike in execution it may be index not going to use for your query when trying with cfqueryparam. I have created same scenario on my development computer but I got same execution time with and without cfqueryparam. There may be some overhead using list as in first query you are passing it directly as test and in second coldfusion need to create from query parameter from provided list but again this should not that much. I will suggest to start "SQL Server Profiler" and monitor query executed on server, this will give you better who costing another 500 ms.

提交回复
热议问题