Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase 12»»

What is Index key Value in SQL SERVER 2005 Expand / Collapse
Author
Message
Posted Wednesday, February 06, 2013 5:15 AM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Monday, May 13, 2013 3:45 AM
Points: 90, Visits: 335
Hi All,

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

>> What is Index Key Value ?

Can any one explain with proper example.

Regards,
Sachin.
Post #1416426
Posted Wednesday, February 06, 2013 6:50 AM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Today @ 4:58 AM
Points: 38,074, Visits: 30,370
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 2008, MVP
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

Post #1416482
Posted Thursday, February 07, 2013 3:02 AM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Monday, May 13, 2013 3:45 AM
Points: 90, Visits: 335
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.
Post #1416915
Posted Thursday, February 07, 2013 3:14 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Wednesday, June 05, 2013 2:40 AM
Points: 5,075, Visits: 4,833
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.




Want an answer fast? Try here
How to post data/code for the best help - Jeff Moden
Need a string splitter, try this - Jeff Moden
How to post performance problems - Gail Shaw
CrossTabs-Part1 & Part2 - Jeff Moden
SQL Server Backup, Integrity Check, and Index and Statistics Maintenance - Ola Hallengren
Managing Transaction Logs - Gail Shaw
Troubleshooting SQL Server: A Guide for the Accidental DBA - Jonathan Kehayias and Ted Krueger

Post #1416920
Posted Thursday, February 07, 2013 3:40 AM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Monday, May 13, 2013 3:45 AM
Points: 90, Visits: 335
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.
Post #1416928
Posted Thursday, February 07, 2013 3:44 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Wednesday, June 05, 2013 2:40 AM
Points: 5,075, Visits: 4,833
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




Want an answer fast? Try here
How to post data/code for the best help - Jeff Moden
Need a string splitter, try this - Jeff Moden
How to post performance problems - Gail Shaw
CrossTabs-Part1 & Part2 - Jeff Moden
SQL Server Backup, Integrity Check, and Index and Statistics Maintenance - Ola Hallengren
Managing Transaction Logs - Gail Shaw
Troubleshooting SQL Server: A Guide for the Accidental DBA - Jonathan Kehayias and Ted Krueger

Post #1416930
Posted Thursday, February 07, 2013 3:59 AM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Monday, May 13, 2013 3:45 AM
Points: 90, Visits: 335
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.
Post #1416938
Posted Thursday, February 07, 2013 4:01 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Wednesday, June 05, 2013 2:40 AM
Points: 5,075, Visits: 4,833
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.




Want an answer fast? Try here
How to post data/code for the best help - Jeff Moden
Need a string splitter, try this - Jeff Moden
How to post performance problems - Gail Shaw
CrossTabs-Part1 & Part2 - Jeff Moden
SQL Server Backup, Integrity Check, and Index and Statistics Maintenance - Ola Hallengren
Managing Transaction Logs - Gail Shaw
Troubleshooting SQL Server: A Guide for the Accidental DBA - Jonathan Kehayias and Ted Krueger

Post #1416941
Posted Thursday, February 07, 2013 4:04 AM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Monday, May 13, 2013 3:45 AM
Points: 90, Visits: 335
Then what will be Index Key in your example.
Post #1416942
Posted Thursday, February 07, 2013 4:06 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Wednesday, June 05, 2013 2:40 AM
Points: 5,075, Visits: 4,833
The data inside columns inside the brackets.

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




Want an answer fast? Try here
How to post data/code for the best help - Jeff Moden
Need a string splitter, try this - Jeff Moden
How to post performance problems - Gail Shaw
CrossTabs-Part1 & Part2 - Jeff Moden
SQL Server Backup, Integrity Check, and Index and Statistics Maintenance - Ola Hallengren
Managing Transaction Logs - Gail Shaw
Troubleshooting SQL Server: A Guide for the Accidental DBA - Jonathan Kehayias and Ted Krueger

Post #1416943
« Prev Topic | Next Topic »

Add to briefcase 12»»

Permissions Expand / Collapse