Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Query performense

Author  Topic 

Avinash_B
Starting Member

1 Post

Posted - 2012-10-09 : 06:01:59
I write two queries
1) ...where id is NUll
it takes 2.45 minutes
2)....where id='asfvdjs362913bds'
it take less than a seconds
how this time differ?
please help me. I am waiting for your valuable suggestions.

I have 160000 record in that table and in that table id doesn't have null value.

chadmat
The Chadinator

1974 Posts

Posted - 2012-10-09 : 14:25:31
Look at the query plan for each query.

-Chad
Go to Top of Page

jackv
Master Smack Fu Yak Hacker

2179 Posts

Posted - 2012-10-09 : 16:11:19
One is probably doing a Scan , the other a seek?


Jack Vamvas
--------------------
http://www.sqlserver-dba.com
Go to Top of Page
   

- Advertisement -