I am trying to search by phone numbers for any phone number containing multiple digits.
Obviously, the following will be slow:
Select * from customer where phone like '%1234%'
I need wildcards because users are allowed to enter any data in the database, so it can have country codes leading 1 (like in 1-800) or back extensions (which sometimes just share space.
Note. I already created βclearedβ phone numbers by deleting all characters without numbers, so I donβt have to worry about dashes, spaces, etc.
Is there any magic to finding this type of search in a reasonable amount of time?
source
share