Advertisement

03.17.2008 at 07:57AM PDT, ID: 23247209
[x]
Attachment Details

Any reason NOT to index a foreign key?

Asked by Maxi84 in MS SQL Server, SQL Server 2005

Tags:

I'm in the middle of what's becoming a rather heated discussion with a client.  The thiong is that I developed a Reporting Services report against three joined views/tables, and it worked great.  Then they move their db to a new server, and also decided to make some of the local views remote.  Now the report hardly works at all.

There are three tables, A, B, and C, with a left join between each.  The join B -> C works great, while A -> B is very slow.  I've told them several times that they need to add a foreign key index on table B that is obviously missing, and they absolutely refuse to do so, saying that this is a 3rd party system that they will not mess with, and at the same time they are not willing to talk to their 3rd party supplier about it.  Instead, they want me to rewrite the report to use sub reports.  I'm telling them that this will take at least two days, that I currentlly don't have the time to do so and that they should at least be willing to try to set the index and see if that works.

I'm running out of arguments here, but can any of you think of a good reason NOT to index a foreign key?  I certainly can't

BTW, all databases are on the same SQL Server 2005 instance.Start Free Trial
[+][-]03.17.2008 at 08:30AM PDT, ID: 21143099

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: MS SQL Server, SQL Server 2005
Tags: MS SQL Server
Sign Up Now!
Solution Provided By: chapmandew
Participating Experts: 2
Solution Grade: B
 
 
[+][-]03.17.2008 at 10:19AM PDT, ID: 21144204

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]03.17.2008 at 01:39PM PDT, ID: 21145905

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628