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

Creating a Non-Cluster Index Expand / Collapse
Author
Message
Posted Tuesday, October 23, 2012 10:12 PM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Friday, June 20, 2014 9:58 AM
Points: 37, Visits: 159
Hi Experts,
I need a small help in creating non cluster index on a table as we were facing a performance issue. The issue was in one of our production server I found that the CPU utilization is going high in peak till 100% and its fluctuating, so I found some queries which are utilizing the CPU resource more, So I run these queries in tuning advisor and got the recommendations to create a non-cluster index on a table but here the index need to be create on a single table but on 18 columns out of 21 in which 1 is a cluster index and 4 are non-cluster index already created.
Please suggest me what I need to do and.
Post #1376313
Posted Tuesday, October 23, 2012 11:39 PM


SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Monday, July 7, 2014 8:21 AM
Points: 33, Visits: 325
Some considerations, although these are general guidelines and all implemenattions should be tested against real data sets . Firstly, don't forget to maintain statistics.

1) Check the WHERE clause , if exact matches are resturned consider a non clustered index
2)If the result sets are smal create a non clustered index
3)Look for distincy value groupings , not found in the clustered index
4)Foreign key columns with joins in the clustered index


Jack Vamvas
sqlserver-dba.com
Post #1376327
Posted Wednesday, October 24, 2012 3:49 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Friday, June 20, 2014 9:58 AM
Points: 37, Visits: 159
Thank you Jack,

for the valuable information I will check it and see what can be changed.

Thank you in advance.
Post #1376390
Posted Wednesday, October 24, 2012 4:40 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Friday, May 30, 2014 8:15 AM
Points: 1,056, Visits: 2,687
1. do you have primary key on the right column?.
2. do you have the query which is peaking the CPU is almost irrelevant to Primary key?.

check the above as well.



Regards
Durai Nagarajan
Post #1376405
Posted Wednesday, October 24, 2012 7:23 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 9:51 AM
Points: 7,127, Visits: 13,503
ksr39 (10/23/2012)
Hi Experts,
I need a small help in creating non cluster index on a table as we were facing a performance issue. The issue was in one of our production server I found that the CPU utilization is going high in peak till 100% and its fluctuating, so I found some queries which are utilizing the CPU resource more, So I run these queries in tuning advisor and got the recommendations to create a non-cluster index on a table but here the index need to be create on a single table but on 18 columns out of 21 in which 1 is a cluster index and 4 are non-cluster index already created.
Please suggest me what I need to do and.


All 18 columns are probably only required in order to make the index "covering". However, creating an index with 18 of the available 21 columns almost duplicates the table. Have a look at the execution plans of those queries and see what you really need to do. Look for the quick wins first - table scans. Then examine the join conditions and WHERE clauses, compare with the indexes you've already got.


“Write the query the simplest way. If through testing it becomes clear that the performance is inadequate, consider alternative query forms.” - Gail Shaw

For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
Exploring Recursive CTEs by Example Dwain Camps
Post #1376459
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse