How to optimize query for "where ... or" SQL?

Viewed 32

Assuming there's a table users with 2 columns: first_name, last_name, and it has 1000k records in it.

I want to know, how to optimize this query:

select * from users where first_name = 'Jim' and last_name = 'Ray'

I have added index for first_name and last_name separately, (each index for one row), however it doesn't take effect.

thanks!

0 Answers
Related