how to find which column takes more time

  • 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

  • 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.



    Clear Sky SQL
    My Blog[/url]

  • 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.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply