DB structure for Twitter home/Facebook wall?
Posted
by mathon12
on Stack Overflow
See other posts from Stack Overflow
or by mathon12
Published on 2010-03-28T21:33:31Z
Indexed on
2010/03/28
21:53 UTC
Read the original article
Hit count: 701
Basically a live feed of all your friends' recent posts.
In a stupid sort of approach I think I'd start by building a query like:
SELECT * FROM tblposts WHERE userid=
friend_id_1OR userid=
friend_id_2......
and so on
Where friend_id_% is the userid of a friend from your friends list. But this must be a very inefficient way of doing it, right? Is there any faster way of doing this in MySQL? Maybe some clever DB schema?
(I know FB uses Hadoob but I'm not experienced enough to go that far :( )
© Stack Overflow or respective owner