Solved

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

Posted on 2007-11-26
5
833 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
ID: 20352377
DO REBUILD
0
 
LVL 6

Author Comment

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

Accepted Solution

by:
JR2003 earned 500 total points
ID: 20352475
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
ID: 20352547
> 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
ID: 20353758
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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Server 2012 VS Server 2016 for SQL Cluster 4 40
Creating SQL script using SQL data and SQL script 8 34
T-SQL: Do I need CLUSTERED here? 13 38
VB.net and sql server 4 33
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
I have a large data set and a SSIS package. How can I load this file in multi threading?
Via a live example, show how to setup several different housekeeping processes for a SQL Server.
Viewers will learn how the fundamental information of how to create a table.

813 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

16 Experts available now in Live!

Get 1:1 Help Now