REGEXP alternative in MySQL for better performance
In a table, we have a column ‘title’ and we are using REGEXP to find any other similar title which matches any word of the first title, however, we are facing some performance issues while using the REGEXP to accomplish this requirement.
Can someone please suggest any other alternative to achieve the requirement?
Example:
title 1 = ‘Human Resources Director’
we are trying to find other titles in the same tables with the below condition. So we need any other title that contains any one of the words(Human or Resources or Director).
SELECT id,title FROM table_name WHERE title REGEXP '\\bHuman\\b|\\bResources\\b|\\bDirector\\b'
Even though we have a separate index on the title it’s not getting utilized.
Read more here: Source link
