Solved

clustered and nc index on same columns- is that harmless

Posted on 2013-01-30
2
253 Views
Last Modified: 2013-02-18
it makes no sense, but the prev designer has a clus index and also nc index on the same set of columns on a table. but is this harmless or can it cause problems..

the reason i ask is that the index was corrupted in this table.. could it have been because of the above fact?

(there are duplicates that should have never gotten in )
0
Comment
Question by:25112
2 Comments
 
LVL 51

Assisted Solution

by:Mark Wills
Mark Wills earned 250 total points
ID: 38839094
Well, cant say that I have done that before, but yes, it is harmless.

It will always maintain the clustered index first, then the NC index gets updated (because the nc index will use the clustered index key to point to data).

Bigger problems is probably those dupes :)

Dont normally use a clustered index on dupe values - it will add a uniquifier and creates a bit more overheads.

Are there any queries or procedures or scripts currently using specific index hints ? If not, then time to tidy up.

While it might be harmless, I would definitely remove the NC index - assuming the clustered index serves a higher purpose.

Do you have a unique index on that table ? If so, would be inclined to use that as your clustered index and then add in the other NC indexes afterwards.
0
 
LVL 69

Accepted Solution

by:
ScottPletcher earned 250 total points
ID: 38844455
Using the same columns for two (or more) indexes won't cause any errors.  The index corruption was caused by something else.

This set up can even be legimitately useful in specific cases, primarily when no other n-c indexes exist on that table.
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
I have a large data set and a SSIS package. How can I load this file in multi threading?
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Viewers will learn how the fundamental information of how to create a table.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now