What is Index key Value in SQL SERVER 2005

  • Hi All,

    I have a question because i confused........

    >> What is Index Key Value ?

    Can any one explain with proper example.

    Regards,

    Sachin.

  • Indexing:

    http://www.sqlservercentral.com/articles/Indexing/68439/

    http://www.sqlservercentral.com/articles/Indexing/68563/

    http://www.sqlservercentral.com/articles/Indexing/68636/

    When you create an index, the column or set of columns that the index is created on is the key columns.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Hi Mr. Gail Shaw,

    Don't mind but i am not getting below sentence.

    The key columns (also referred to as the index key) can be likened to the terms listed in a book index. They are the values that the index will be used to search for. As with the index found at the back of a text book (see figure 1), the index is sorted by the key columns.

    Regards,

    Sachin.

  • dsachu (2/7/2013)


    Hi Mr. Gail Shaw,

    Don't mind but i am not getting below sentence.

    The key columns (also referred to as the index key) can be likened to the terms listed in a book index. They are the values that the index will be used to search for. As with the index found at the back of a text book (see figure 1), the index is sorted by the key columns.

    Regards,

    Sachin.

    1st Gail is a lady, so Mr. isn't the correct title to address her by.

    2nd. I am sure you have read a book at some point (non-novel), at the back of the book there is an index, with a list of major topics, sorted in order from A - Z. That is the same methodology that a SQL index takes, it is a way to search quickly for what you want to find. Eg. I want information on Blocking, look in the index, find the page numbers which blocking is refered to, then you know where to look for the information. Same in SQL, I want to look for all people who have a first name 'Anthony', SQL looks in the index, finds the right page numbers where the name 'Anthony' appears and you get the information you need.

  • Hi,

    Sorry.....actual on the basis of Gail Photo, I assume he is Mr.

    ----------

    I have Table ABC. Where I have one Column Country id on which I have implemented primary key .

    What will be Index key value in below given table.

    As per my understanding 1,2,3,4,5 will be the index key value......is am right ?

    Country ID (PK)Country Name

    --------------- --------------

    1 UK

    2 US

    3 Japan

    4 India

    5 China

    Regards,

    Sachin.

  • dsachu (2/7/2013)


    Hi,

    Sorry.....actual on the basis of Gail Photo, I assume he is Mr.

    ----------

    I have Table ABC. Where I have one Column Country id on which I have implemented primary key .

    What will be Index key value in below given table.

    As per my understanding 1,2,3,4,5 will be the index key value......is am right ?

    Country ID (PK)Country Name

    --------------- --------------

    1 UK

    2 US

    3 Japan

    4 India

    5 China

    Regards,

    Sachin.

    Correct, that ever is in the create index statement (exlcuding included columns) is the index key value

    EG.

    CREATE INDEX IDX_Name ON Ant (Name) - Index Key value is Name

    CREATE INDEX IDX_Name_DOB ON Ant (Name,DOB) - Index Key value is Name & DOB

    CREATE INDEX ISX_Name_DOB ON Ant (Name,DOB) INCLUDE (Salary) - Index Key value is Name & DOB

  • Hi

    Again some confusion.

    -------------------------

    >> CREATE INDEX IDX_Name ON Ant (Name) - Index Key value is Name

    Ant is your column right ? and Name is one record in this column

    >> CREATE INDEX IDX_Name_DOB ON Ant (Name,DOB) - Index Key value is Name & DOB

    Ant is your column right ? and Name and DOB is two different record in this column

    Please clarify.

    Regards,

    Sachin.

  • No, Ant is the table, the columns are Name, DOB, Salary.

    Take a look at the CREATE INDEX syntax.

    Indexes are not defined on row, they are defined on columns.

  • Then what will be Index Key in your example.

  • The data inside columns inside the brackets.

    The Index Key is the columns, the value is the data inside the columns

  • anthony.green (2/7/2013)


    The data inside columns inside the brackets.

    The Index Key is the columns, the value is the data inside the columns

    It means in your Example :

    Table : Ant

    Column :

    Name ( Index Key )

    -----------------------------

    Sachin ( Index Key Value )

    Gail ( Index Key Value )

    Rakesh ( Index Key Value )

    Antony ( Index Key Value )

    I think now I am absolutely right....if you will confirm that i am right then my confusion will be end.

    Regards,

  • dsachu (2/7/2013)


    anthony.green (2/7/2013)


    The data inside columns inside the brackets.

    The Index Key is the columns, the value is the data inside the columns

    It means in your Example :

    Table : Ant

    Column :

    Name ( Index Key )

    -----------------------------

    Sachin ( Index Key Value )

    Gail ( Index Key Value )

    Rakesh ( Index Key Value )

    Antony ( Index Key Value )

    I think now I am absolutely right....if you will confirm that i am right then my confusion will be end.

    Regards,

    correct

  • anthony.green (2/7/2013)


    dsachu (2/7/2013)


    anthony.green (2/7/2013)


    The data inside columns inside the brackets.

    The Index Key is the columns, the value is the data inside the columns

    It means in your Example :

    Table : Ant

    Column :

    Name ( Index Key )

    -----------------------------

    Sachin ( Index Key Value )

    Gail ( Index Key Value )

    Rakesh ( Index Key Value )

    Antony ( Index Key Value )

    I think now I am absolutely right....if you will confirm that i am right then my confusion will be end.

    Regards,

    correct

    last one more thing on the basis of book index......

    suppose i have content where i would like to know from your side what will be Index Key & Index key value in below given scenario..

    abstraction, services795

    access control list732

    accessing hardware counter573

    this is last scenario please...

  • Depends on the table definition and the columns

    Index Key is the column

    Index Key value, is the data in the column

  • anthony.green (2/7/2013)


    Depends on the table definition and the columns

    Index Key is the column

    Index Key value, is the data in the column

    Hi,

    Please clarify below statement.

    >>In the leaf level, there’s one entry for each row in the index. The entries in the index are ordered logically in the order of the index key.

    I am not getting [b]there’s one entry for each row in the index[/b]

    Regards,

    Sachin.

Viewing 15 posts - 1 through 15 (of 15 total)

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