I have two tables:
Sale > 100 Records Primary key fields: Invoice
Payments > 200,000 Records Primary key fields: Id, Invoice, SalesType, Document.
I have the following SQL:
Select V.FATURA, P.ID
From Venda V
Left Join Pagamentos P on p.FATURA = V.FATURA
Where v.DTEMI between '25.09.2018' and '25.09.2018'
But it is very slow. What can I do to improve performance?