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 «««23456

Clustered indexes Expand / Collapse
Author
Message
Posted Tuesday, May 11, 2010 8:06 PM


SSCrazy Eights

SSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy Eights

Group: General Forum Members
Last Login: Yesterday @ 12:05 PM
Points: 8,556, Visits: 9,047
Cliff Jones (5/6/2010)
What threw me off was "All nonclustered indexes include the clustered index columns in their index pages" . I thought this was incorrect because the clustered index columns are contained in the Leaf Node Data Pages and not every index page.

This nearly threw me off too, but I decided that as it didn't say "in all their index pages" it was actually correct and picked the right answer. I can't say that I particularly like questions where one has to take a lawyer-like attitude to the phrasing, but any dba or developer has to read the small print in requirement statements so maybe it's good practice for us and therefor I don't particularly dislike them either (unless they are really silly extreme cases of it, which this one isn't).


Tom
Post #920125
Posted Friday, May 14, 2010 10:38 PM


SSCarpal Tunnel

SSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal Tunnel

Group: General Forum Members
Last Login: Yesterday @ 6:09 PM
Points: 4,000, Visits: 6,058
Tom.Thomson (5/11/2010)
Cliff Jones (5/6/2010)
What threw me off was "All nonclustered indexes include the clustered index columns in their index pages" . I thought this was incorrect because the clustered index columns are contained in the Leaf Node Data Pages and not every index page.

This nearly threw me off too, but I decided that as it didn't say "in all their index pages" it was actually correct and picked the right answer. I can't say that I particularly like questions where one has to take a lawyer-like attitude to the phrasing, but any dba or developer has to read the small print in requirement statements so maybe it's good practice for us and therefor I don't particularly dislike them either (unless they are really silly extreme cases of it, which this one isn't).



I missed this one as well, because I read the clustered index columns to mean all columns, not just the columns comprising the clustered index key. Since the clustered index is the base table, and since all non-clustered indexes do NOT include all columns in the base table... I died.

Really good question though.





__________________________________________________

Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? -- Stephen Stills
Post #922416
Posted Saturday, May 15, 2010 8:37 AM
Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: 2 days ago @ 7:30 AM
Points: 3,871, Visits: 3,621
The Dixie Flatline (5/14/2010)
Tom.Thomson (5/11/2010)
Cliff Jones (5/6/2010)
What threw me off was "All nonclustered indexes include the clustered index columns in their index pages" . I thought this was incorrect because the clustered index columns are contained in the Leaf Node Data Pages and not every index page.

This nearly threw me off too, but I decided that as it didn't say "in all their index pages" it was actually correct and picked the right answer. I can't say that I particularly like questions where one has to take a lawyer-like attitude to the phrasing, but any dba or developer has to read the small print in requirement statements so maybe it's good practice for us and therefor I don't particularly dislike them either (unless they are really silly extreme cases of it, which this one isn't).



I missed this one as well, because I read the clustered index columns to mean all columns, not just the columns comprising the clustered index key. Since the clustered index is the base table, and since all non-clustered indexes do NOT include all columns in the base table... I died.

Really good question though.



Hugo concedes that that particular answer was not worded correctly, so that is good enough for me.

Post #922495
Posted Wednesday, August 25, 2010 9:41 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Tuesday, November 8, 2011 7:55 AM
Points: 70, Visits: 53
Hmm...

"A clustered index determines the physical order of data in a table. A clustered index is analogous to a telephone directory, which arranges data by last name. Because the clustered index dictates the physical storage order of the data in the table, a table can contain only one clustered index. ."

"A clustered index is particularly efficient on columns that are often searched for ranges of values. After the row with the first value is found using the clustered index, rows with subsequent indexed values are guaranteed to be physically adjacent."

http://msdn.microsoft.com/en-us/library/aa933131(SQL.80).aspx
Post #974985
Posted Wednesday, August 25, 2010 11:53 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Yesterday @ 7:40 AM
Points: 5,916, Visits: 8,168
m.bouffard (8/25/2010)
Hmm...

"A clustered index determines the physical order of data in a table. A clustered index is analogous to a telephone directory, which arranges data by last name. Because the clustered index dictates the physical storage order of the data in the table, a table can contain only one clustered index. ."

"A clustered index is particularly efficient on columns that are often searched for ranges of values. After the row with the first value is found using the clustered index, rows with subsequent indexed values are guaranteed to be physically adjacent."

http://msdn.microsoft.com/en-us/library/aa933131(SQL.80).aspx

The first quote is correct. The clustered index does "dictate" the physical storage order. That does not imply that the ordering of the physical storage matches that of the index. Data pages can be scatered through the file; traversing the index in order is done by following the "next page"/"previous page" pointers in the data pages.

The second quote is incorrect. Rosw with subsequent indexed values are guaranteed to be on the same page or on the next page when following the the pointer chain. They might be physically adjacent, but there is no guarantee at all.

Here is how the current version of Books Online describes clustered indexes: http://msdn.microsoft.com/en-us/library/ms177443.aspx



Hugo Kornelis, SQL Server MVP
Visit my SQL Server blog: http://sqlblog.com/blogs/hugo_kornelis
Post #975071
« Prev Topic | Next Topic »

Add to briefcase «««23456

Permissions Expand / Collapse