Solved

Creating Indexes on a Table And Improving performance

Posted on 2009-07-13
1
192 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

PL/SQL can be a very powerful tool for working directly with database tables. Being able to loop will allow you to perform more complex operations, but can be a little tricky to write correctly. This article will provide examples of basic loops alon…
This article describes how to use the timestamp of existing data in a database to allow Tableau to calculate the prior work day instead of relying on case statements or if statements to calculate the days of the week.
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
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 …

770 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