Need MySQL tables design and Php functions to:
1. Show friends of friends
2. Show mutual friends with some user
3. Show friends of friends,I'm not already connected with.
4. Show friends of friends who are online.
5. Show friends path.
MySQL queries should use "order by" so that newest members are on the top of the list.
All MySQL queries must be optimized/indexed so that they work without problems on a busy website with hundreds of thausands of users and can work on MySQL clusters.
This is a running website and I already have MySQL user tables: users_table and online_users. So, I need redesign friends tables.