Solved

Creating Indexes on a Table And Improving performance

Posted on 2009-07-13
1
194 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
performance query 4 37
SQL Recursion 6 34
Help with Progress 4gl Rounding Function 6 27
SQL query 7 18
Introduction Hopefully the following mnemonic and, ultimately, the acronym it represents is common place to all those reading: Please Excuse My Dear Aunt Sally (PEMDAS). Briefly, though, PEMDAS is used to signify the order of operations (http://en.…
Composite queries are used to retrieve the results from joining multiple queries after applying any filters. UNION, INTERSECT, MINUS, and UNION ALL are some of the operators used to get certain desired results.​
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

733 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