|
|
|
SSC-Dedicated
           
Group: General Forum Members
Last Login: Today @ 10:27 AM
Points: 37,648,
Visits: 29,900
|
|
JacekO (1/26/2011)
Wow, Now instead of giving me a fish you are trying to send me out to sea with a net... 
And instructions.
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
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Wednesday, April 06, 2011 9:00 AM
Points: 6,
Visits: 16
|
|
I'm an extreme Newbie and I'm trying to clarify my own understanding of indexes. You mentioned that,
"The non-leaf levels of the index contain one row per page of the level below, referencing the lowest index key value on each page."
Correct me if I'm wrong, but the root page contains the actual values from the index column.
ID 1 2 3 4
This can span out if the index column has 10,000 records?
ID 1 2 3 ... .. 10,000
those values are divided up within the Intermediate Level
ID (Intermediate1) 1 2 3 4
ID (Intermediate2) 5 6 7 8
this spread across to accomodate the number of rows in the index column ID (IntermediateN?) .. .. record 10,000
this is then populated in the Leaf level? Is this presumption, correct? Thanks,
|
|
|
|
|
SSC-Dedicated
           
Group: General Forum Members
Last Login: Today @ 10:27 AM
Points: 37,648,
Visits: 29,900
|
|
I'm not sure I understand you. I suggest you read parts 2 and 3 where I have diagrams of the index structure.
The only level of the index that has all key values is the leaf level.
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
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Sunday, March 03, 2013 2:50 AM
Points: 112,
Visits: 294
|
|
| Gail is right - the root and intermediate index levels store only key range boundary values since all they are required for are routing to the relevant next page. There is no reason to store every value - that would be inefficient.
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Wednesday, April 06, 2011 9:00 AM
Points: 6,
Visits: 16
|
|
Thank you for the response. I read the 2nd article and I notice that in your diagram you have
1 4 13
for the Intermediate Level. And like your last response, the leaf level contains all of the data for the particular row.
1 Mr. Adam Taylor 2. Mr. Richard Wright 3. Miss Helen Smith
Which I follow. My confusion is with the root and intermediate pages. From your diagram, am I to assume that the root page contain the indexed column and all of the values from the index column. From
1 to 137?
Secondly, the Intermediate pages (level) hold segments of those values from the indexed column?
|
|
|
|
|
Right there with Babe
      
Group: General Forum Members
Last Login: Friday, May 10, 2013 11:54 AM
Points: 749,
Visits: 3,767
|
|
A phone book analogy is often used here. You have a list of people's names in a phone book. The root would be analogous to the first letter of their last names. The intermediate would be subgroups of that, so, for example, Smith to Styles (but not their individual values), and the leaf would be the individual entries (each person's name (and telephone number)).
(Changed my avatar from a Husky to Carl from the movie UP! for the new year. )
______________________________________________________________________ The greatest enemy of knowledge is not ignorance, it is the illusion of knowledge. - Stephen Hawking
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Wednesday, April 06, 2011 9:00 AM
Points: 6,
Visits: 16
|
|
Yes! Now it makes sense. I couldn't grasp the Intermediate Level and it's use.
Danke!
|
|
|
|
|
SSC-Dedicated
           
Group: General Forum Members
Last Login: Today @ 10:27 AM
Points: 37,648,
Visits: 29,900
|
|
vj2173 (1/28/2011)
From your diagram, am I to assume that the root page contain the indexed column and all of the values from the index column. From
1 to 137?
No. Just 1 and 137. It doesn't need any values between those, the root only stores the starting value for each page beneath it
Secondly, the Intermediate pages (level) hold segments of those values from the indexed column?
Again, no. The intermediate pages in that diagram contain only the values specified. Like the root, the lowest key value for each page beneath it.
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
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Monday, April 22, 2013 2:31 AM
Points: 199,
Visits: 205
|
|
Clustered indexes define the logical order of the table
I would say: Clustered indexes define the physical order of the table. Am I right?
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Tuesday, May 07, 2013 5:52 AM
Points: 165,
Visits: 1,022
|
|
e-ghetto (7/3/2012)
Clustered indexes define the logical order of the table I would say: Clustered indexes define the physical order of the table. Am I right? No. There is no guarantee of physical order whatsoever. It's the logical order.
|
|
|
|