I have a huge members database. Let's say I have 10 names.
I need to fetch these members' last seen values from members table in a fastest way. I have tried
SELECT lastseen FROM members WHERE
SELECT lastseen FROM members WHERE name IN ('Pierce', 'John', . . . )
In MySQL, there is even a performance advantage to using
IN instead of
ORs. MySQL will create a binary tree for searching the values (assuming they are constants), which speeds up the processing.