0

I have query which uses like with "%search_pattern%" which is taking high CPU utilization if i hit 5-6 parallel request, my table has data around 30 Million.

Can any alternative methods or algorithm be used to optimize that?

Ex:

SELECT * FROM USER_DETAILS U WHERE U.NAME LIKE %JOHN%';

CPU Utilization is going to 700%

1

1 Answer 1

1

When you use LIKE '%JOHN%' mysql cant use a index and must compare each ROW with the String. The only way to use a Index is use LIKE 'JOHN%' ´. look if a index on NAME

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.