¿Puede alguien ayudarme a sintonizar esta consulta SQL?¿Por qué este SQL da como resultado Index Scan en lugar de Index Search?
SELECT a.BuildingID, a.ApplicantID, a.ACH, a.Address, a.Age, a.AgentID, a.AmenityFee, a.ApartmentID, a.Applied, a.AptStatus, a.BikeLocation, a.BikeRent, a.Children,
a.CurrentResidence, a.Email, a.Employer, a.FamilyStatus, a.HCMembers, a.HCPayment, a.Income, a.Industry, a.Name, a.OccupancyTimeframe, a.OnSiteID,
a.Other, a.ParkingFee, a.Pets, a.PetFee, a.Phone, a.Source, a.StorageLocation, a.StorageRent, a.TenantSigned, a.WasherDryer, a.WasherRent, a.WorkLocation,
a.WorkPhone, a.CreationDate, a.CreatedBy, a.LastUpdated, a.UpdatedBy
FROM dbo.NPapplicants AS a INNER JOIN
dbo.NPapartments AS apt ON a.BuildingID = apt.BuildingID AND a.ApartmentID = apt.ApartmentID
WHERE (apt.Offline = 0)
AND (apt.MA = 'M')
.
Aquí es lo que el plan de ejecución se parece a:
.
Lo que no entiendo es por qué estoy recibiendo un recorrido de índice de NPapplicants. Tengo un índice que cubre BuildingID y ApartmentID. ¿No debería ser eso usado?
¿Cuántas filas hay en la tabla NPapplicants? –
La imagen muestra 7775, de la última actualización de estadísticas – RichardTheKiwi