Hi there, In one of my query,when i am test and providing the hard coded values in the where close for the filter, it finishes the query in less than 1 second. But in real stored procedure, those values in the where cluase are coming from variables declared with in the same stored procedure. Like @batchid and all and with all this, its taking more than 8 seconds to finish the query. Why is this happening? and what can i do to fix it? Thanks alot in advance!