0

In a social networking site we have a scenario like taking news feed of friends against logged in user.

I have a user table, membership table and feed table. Here membership table is using for friends data. User table have more than 100K entries and membership take have more than 400K entries.

I have two way to take friends feed... Either by joining the feed and membership tablle

select * from feed join membership on ... where ....

Or by IN statement like

select * from feed where user_id IN (userids of friends)

Here i am facing a loading issue when making a join statement for a newly registered user having a single friend.

So which is the best method for along robust future run ?

kwelsan
  • 1,229
  • 1
  • 7
  • 18
jpk
  • 189
  • 4
  • 13
  • If you want to use data from the `membership`-table you have to use a join. But if not a `IN` is fine to go with. – Tobias Golbs Mar 10 '14 at 08:24
  • Below link will help you for better understand.... http://stackoverflow.com/questions/2577174/join-vs-sub-query – Sadikhasan Mar 10 '14 at 08:27

0 Answers0