Doubt on indexs

  • Dear All,

    One interviewer asked me the following question.

    We create a clustered index and another non-clustered index on a table.If we execute a query which uses the non-clustered index, how it will bring the records .?

    What should be the answer.?

    Thanks in advance.

  • 2005/2008 refers to it as a key lookup, but it's the same thing as a bookmark lookup. You can read about it in the books online. It has to do with how the data is stored.

    One question you should ask back to the reviewer... "Is the non-clustered index a covering index?"

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • I agree with Grant's last statement.

    There shouldn't be any look-ups if the index is covering all the columns in the sql statement. The quest is not clear enough in my eyes. I would definitely ask some of my own questions before replying.

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life

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

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