Solved

Adding Indexes to Table hurts query performance (self-join)

Posted on 2007-11-26
5
832 Views
Last Modified: 2012-06-27
I'm optimizing a query on SQL 2000.  The query joins a single table to itself 5 times to get various MAX(values).  

When I add a large covering clustered (or non-clustered index) to the table to help the query, performance suffers greatly.  This is a select statement only.

Why would a large index negatively impact read performance ?
0
Comment
Question by:JaffaKREE
  • 2
  • 2
5 Comments
 
LVL 16

Expert Comment

by:SQL_SERVER_DBA
Comment Utility
DO REBUILD
0
 
LVL 6

Author Comment

by:JaffaKREE
Comment Utility
Rebuild the index ?  I've just created it.
0
 
LVL 18

Accepted Solution

by:
JR2003 earned 500 total points
Comment Utility
How many rows has the table?
Are you accessing columns that aren't in the index?
Can you paste the query in with the indexes you have created?
0
 
LVL 6

Author Comment

by:JaffaKREE
Comment Utility
> Are you accessing columns that aren't in the index?

After looking at this, I believe I made a mistake and excluded a necessary column from the index.  

I was concerned that the process, since it was accessing the same table/index 5 times, may have been deadlocking/blocking itself.


0
 
LVL 18

Expert Comment

by:JR2003
Comment Utility
sometimes it does take longer using an index depending one how many rows are accessed and what columns are on the index.
0

Featured Post

Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

Join & Write a Comment

Performance is the key factor for any successful data integration project, knowing the type of transformation that you’re using is the first step on optimizing the SSIS flow performance, by utilizing the correct transformation or the design alternat…
Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

771 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

9 Experts available now in Live!

Get 1:1 Help Now