What is the best friend-list table design (for performance)? Probably there should not be many rows for every friendship. What Facebook and Myspace is doing? (in MySQL)
What is the best friend-list table design (for performance)? Probably there should not be
Share
Assuming you have a separate users table, it would just be a table where each row has two user ids (e.g., user, friend) and possibly a third column to indicate the strength of the relationship (BFF, acquaintances, etc). You can add unique constraints to make sure you don’t have duplicates where the same pair is saved as (user, friend) and (friend, user).