sql - SELECT IN for a large set -
In my web application, I want to know which of the user's users on Twitter are already on the system. .. What I am currently doing is acquiring the list of Twitter IDs, which is following the user (Twitter API returns ID 5000 at one time), and is doing it:
Select from user where user ID (COMMA_SEPARATED_LIST_OF_ID);
I do not feel comfortable about this question because as the user grows the table, this bottle can be a neck. I do not want to optimize prematurely, so is there any other way I should do this?
Update: I am using MySQL.
two approaches:
-
SELECT IN (Expr)
can be aSELECT
expression forexpr
i.e. The database can handle large amounts of data here. -
Use any included.
Comments
Post a Comment