I have a select command which has a table which is used in multiple joins. But, that table is not part of any WHERE clause, ORDER clause nor present in the field list. If you ask why I have multiple joins on that table, it is because sometimes user may enter search on those fields and they would then be needed in the WHERE clause. IAC, this is not related here.
So, knowing that, this table is used in four INNER JOINs. It is always the same syntax such as:
INNER JOIN Member ON Client.NoMember=Member.Numero
INNER JOIN Member AS Member2 ON Client.NoMember2=Member.Numero
INNER JOIN Member AS Member3 ON Client.NoMember3=Member.Numero
INNER JOIN Member AS Member4 ON Client.NoMember4=Member.Numero
However, when I look at the execution plan, on those four items, the plan is using an index which is totally not related instead of using the Member.Numero primary key index. It does indicate that Member.Numero is used in the Output. Yes, it is an output here but that would be much better optimized if it would use the Member.Numero primary key index instead.
Anyone has found a way around that?