I have a table called numbers, in this series are phone numbers for example
5255, 'Mexico CDMX'
5233, 'Mexico Guadalajara'
5281, 'Mexico Monterrey'
I have an sp that receives a complete number example 525578547854, the sp should tell me that this number belongs to Mexico CDMX, currently as I do it is the following
SELECT Destino FROM Numeros WHERE '525578547854' LIKE CONCAT(Codigo, '%')
Any ideas on how to do it faster?
The query takes 72 ms to run
Thanks