I have a query like
select C.customerId, C.firstName, C.LastName, R.IsActive from
Customer as C
Inner join Rider as R ON R.customerId = C.customerid
where R.rideid = 'xyz' and
R.rideareacode = 'abc' and
R.isActive = 1
This is taking too much like 90 seconds or more. But if I remove the R.IsActive = 1 condition query is taking only a second.
IsActive has only two values 1 or 0, also the Customer and Rider table are big (80k rows)
I tried indexing the IsActive column of my Rider table but still the query is taking too much, I also tried indexing (rideid, rideareacode, isActive) still it is taking too long.
Rancha124 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1