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:

  1. SELECT IN (Expr) can be a SELECT expression for expr i.e. The database can handle large amounts of data here.

  2. Use any included.


Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -