July 2, 2009 at 2:34 am
hi,
i am using select statement and using some conditions i am fetching the values from the table.
How can i know the time taken for each conditions.
eg:
select jobid,title,name,dob from jobdetails where jobid>=10 and dob between '10-01-1982' to '20-03-1987'
in the above select statement how can we know the how many time is taken for checking the jobid condition and for dob.
can any one help me.....
Regards,
Prakash
July 2, 2009 at 3:06 am
There really is not a simple answer , but its all down to understanding the query plan.
Heres a link to an ebook on the subject.
July 2, 2009 at 8:17 am
As David has said there isn't a simple answer. The Optimizer checks the conditions and then makes a best guess as to what access path will be the best, it may be to use an index on jobid and then a bookmark/key lookup to get the rest. If you happen to have an index on jobid, dob then it would be likely that SQL Server would choose that index.
It all depends on indexes and distribution of the data. What is fast for one jobid, dob combination my be slow for another one.
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply