I’m going to read records from database(MySQL) by name using this select statement:
select * from table where name = 'xxx'
But I have hundreds of names in one http request, so if I use the above statement, I have to issue hundreds of select. Or I just use MySQL select .. in to reduce sql calls.
But it’s still too slow. So, any better approach to archieve my purpose? Thanks in advance!
1st thing you should have index on ‘name’ if you are using in where condition. And if you have more conditions in where try to figure out more which more columns can have indexes.
2nd thing use IN query it will solve minimize your database calls.