Key Lookup does not go away

Guru 2016-06-02 20:07:57

I have recompile the proc, reorganize all, reindexed, added two Non-Clustered index(s)

Sales.Contract table:

ID, column included ContractNBR, CustomerID and Vehicle ID

Contract, column included CustomerID, DealerID, ID, and Vehicle ID

Any help would be really appreciated.

Thanks,
Guru

SQLkiwi 2016-06-02 20:47:45
A covering index would be:

CREATE INDEX [IX Sales.Contract DealerID (ContractNbr, CustomerID, VehicleID)]
ON Sales.Contract
    (DealerID)
INCLUDE
    ContractNbr,
    CustomerID,
    VehicleID,
    ID;

…or adjust the existing index NDX_DealerID accordingly.