For simplicity, let’s assume we have a single feed for all users.
The feed is just a list of articles.
Each user is free to favorite a certain article or remove it from their personal view.
User deleting an article does not affect other users; each user has its own “view” of the feed.
Simple Approach
A naïve scheme I devised is below:

(Of course, in the real application there is more to user-article relationship than just hiding or starring.)
The Problem
It looks like the link table entry should be created lazily, after the first change of options. Otherwise, when a new user signs up, or a new article pops up, we’d have to create a lot of empty link records, and also handle concurrency.
This means selecting a list of articles for a certain user is a query that combines:
- selecting all articles for which
ArticleUserLinkdoes not exist; - selecting all articles for which
ArticleUserLinkexists and hasis_hidden = 0.
Is
ORthe answer here, or is there a more effective database design / query to solve the problem?
how about using an inner query?