Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2005 > BOOK: Beginning SQL Server 2005 Programming ISBN: 978-0-7645-8433-6
|
BOOK: Beginning SQL Server 2005 Programming ISBN: 978-0-7645-8433-6
This is the forum to discuss the Wrox book Beginning SQL Server 2005 Programming by Robert Vieira; ISBN: 9780764584336
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning SQL Server 2005 Programming ISBN: 978-0-7645-8433-6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 14th, 2009, 06:01 PM
Registered User
 
Join Date: Jun 2009
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Question Do non-clustered indexes on a clustered table always have to make two lookups?

Hello,

When you create a clustered index on a table, any data lookup will go all the way through the B-Tree from the root to the leaf-level node which in this case would be the actual data.

In the case of a non-clustered index on a heap, the process is much the same way, except that the leaf-level nodes will give you a reference (RID) to the data page.

Now, when you create a non-clustered index on a clustered table, my undersatnding is that the process will change in that any lookup will be made first through the non-clustered B-Tree which will give you the CLUSTERED key to perform another lookup through the clustered B-Tree in which you'll finally get to the data page that you are looking for.

My question for you guys is: is there any way to change that behavior in a way that we could force the non-clustered index on a clustered table work just as the non-clustered index on a heap? (I mean, to get the RID from the leaf-level node of the non-clustered B-Tree instead of the clustered key)

Thanks in advance for your help.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Clustered Index Scan bmains SQL Server 2000 5 June 7th, 2010 11:35 AM
Clustered and Non-clustered Index plugsharma SQL Language 0 December 17th, 2008 10:21 AM
Page splits - Clustered vs Non-Clustered Index carumuga SQL Server 2005 3 October 20th, 2008 04:23 AM
Clustered PK Constr fails to create on big table kapluni SQL Server 2000 5 November 23rd, 2005 06:27 PM
Question about clustered indexes patwadd SQL Server 2000 1 July 15th, 2005 05:01 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.