Parameterized query response time
Posted: Wed 30 Mar 2011 06:52
I have a query which select values from 4 tables and "where" contains 22000 record with "or".
like :
....where SITENAME =:1 OR SITENAME =:2 OR SITENAME =:3 OR SITENAME =:4 ....................
this parameterized query's result return at 4 mins.
--------------------------------------------------------------------------------
on the other hand if i prepare query string on c# like
like
...where SITENAME ='12345' OR SITENAME ='12346' OR SITENAME ='12347' OR SITENAME ='12348' ....................
this generated string query's result return 17 secs
---------------------------------------------------------------------------------
Something is wrong ?
i have to use parameterized query. What is the problem and how can fix this?
Thanks.
NOTE : if you need i can put here all query (it is big)
like :
....where SITENAME =:1 OR SITENAME =:2 OR SITENAME =:3 OR SITENAME =:4 ....................
this parameterized query's result return at 4 mins.
--------------------------------------------------------------------------------
on the other hand if i prepare query string on c# like
like
...where SITENAME ='12345' OR SITENAME ='12346' OR SITENAME ='12347' OR SITENAME ='12348' ....................
this generated string query's result return 17 secs
---------------------------------------------------------------------------------
Something is wrong ?
i have to use parameterized query. What is the problem and how can fix this?
Thanks.
NOTE : if you need i can put here all query (it is big)