title: efficiently showing the user only items he did not already see before (mysql)
body: <p>This question applies to any kind of system that contains items (e.g: news articles) and users that watch these items.</p>
  
  <p>So let's say i have a users table <code>([id],[username])</code>, an articles table <code>([id],[title],[text])</code> and a table that contains all the articles viewed by all the users <code>([user_id],[article_id])</code>.</p>
  
  <p>What i want to do is efficiently show the user only the articles he did not already read before.</p>
  
  <p>I know i can just do something like </p>
  
  <pre><code>select id,title,text from articles where id not in (select article_id
  from article_views where user_id = 123)
  </code></pre>
  
  <p>But what if the current user already read 1M articles ?  the query will become something like </p>
  
  <pre><code>select id,... from articles where id not in (1,2,3,......1000000)
  </code></pre>
  
  <p>This, i can assume, is too slow to be practical.</p>
  
  <p>Also, it sucks because the more articles a user reads - the slower response time he will have retrieving new (unread) articles..</p>
  
  <p>Any other suggestions, db-wise ?</p>