mah_j (10/23/2016)
But the Invoiceuid is PK and has a clustered index in dbo.Invoice table.ALTER TABLE [dbo].[Invoice]
ADD CONSTRAINT [PK_Invoice] PRIMARY KEY CLUSTERED([InvoiceUID] ASC)
The problem is still that the query is seeking on the index for almost 1M rows, adding the new index would bring this down to a reasonable number.
😎