mercredi 27 juillet 2016

Firebird query takes unusually long time to process

I am executing following query which contains 3000 conditions inside in operator.

select * from Orders a where a.key 
 in(101,155,16,45,778,9,8,67,1,44,455,56,88,888,8888,88888,77777,77,78, 3000) 

Number of numeric values inside in is 3000. This query is working very slow and sometimes it throws an exception. Is there any other way to write this query.

Aucun commentaire:

Enregistrer un commentaire