I have a query similar to this:
SELECT CustomerId
FROM Customer cust
WHERE 'SoseJost75G' LIKE cust.ClientCustomerId + '%'
The bottom line is what it is, I get from the client that it is mine ClientCustomerId, but with an unknown number of additional characters attached to the end.
So, in my example, the client gives me SoseJost75G, but my database only has SoseJost(without 75Gat the end.)
My request is working. But it will take a minute to run. This is due to the fact that it cannot use the index that is on ClientCustomerId.
Does anyone know how to improve the performance of this type of query?
source
share