Solved

Creating Indexes on a Table And Improving performance

Posted on 2009-07-13
1
193 Views
Last Modified: 2012-05-07
My table has a composite primary key on five columns, so indexes also have five columns. If I want to improve performance can I drop the composite index and build an index on each of the five columns individually? Would this help me in improving performance?
0
Comment
Question by:ken hanse
1 Comment
 
LVL 11

Accepted Solution

by:
anilallewar earned 250 total points
ID: 24846559
Not necessarily; depends on the data distribution. Is your primary key is clustered? If so ensure that the most frequent column on which you query is the first in the primary composite key. If you use group by column create seconday indexes with first column in primary key and the group by columns. This way you can use the physical ordering clreated by the clusterred index and the group by column.

I had a similar situation for a reporting application which had around 40 million records and close to 400 bytes per row. The table previously had a primary key on identity(sequence) column and indexes on all other columns that could be part of dynamic select statements. The performance was poor.

We changed the index structure to have primary key on the 2 most used columns and the sequence(resulting in unique primary key) and non-clustered indexes on other columns which were part of group by. The non-clustered indexes were created as combination of first column in primary key and group by column.

The performance improvment we got was close to 4000% on an average!!
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

I'm trying, I really am. But I've seen so many wrong approaches involving date(time) boundaries I despair about my inability to explain it. I've seen quite a few recently that define a non-leap year as 364 days, or 366 days and the list goes on. …
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…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

860 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