Friends by Waindigo [Deleted]

# Query_time: 1.895558 Lock_time: 0.000021 Rows_sent: 15 Rows_examined: 376937
SET timestamp=1409819977;
SELECT friend.*, user.*, mutual_friend.friend_state AS mutual_friend_state
FROM xf_friend AS friend
INNER JOIN xf_user AS user
ON (((user.user_id = friend.user_id AND friend.user_id != '69102')
OR (user.user_id = friend.friend_user_id AND friend.friend_user_id != '69102')) AND user.is_banned = 0)
LEFT JOIN xf_friend AS mutual_friend
ON ((user.user_id = mutual_friend.user_id AND mutual_friend.friend_user_id = '0')
OR (user.user_id = mutual_friend.friend_user_id AND mutual_friend.user_id = '0'))
WHERE (friend.user_id = '69102' OR friend.friend_user_id = '69102')
AND friend.friend_state = 'confirmed'
LIMIT 30;

Could you please do something about this query being absurd for users with any significant number of friends? :(

You can see this is even after I've limited it to 30 to reduce some users profile page initial load times being over 20 seconds
 
We've disabled this add on as it has had far far too much of a negative impact on the performance of the website it was used on.

Will reconsider it if it the queries are ever improved or caching is added to prevent pseudo DOS attacks occurring simply from multiple users with high friend counts having their profiles loaded simultaneously
 
1.4 errors a popup clicking on a username to get the membercard popup.. Error in ACP is...

ErrorException: Fatal Error: Call to undefined method XenForo_Model_User::getFriendRecord() - library/Waindigo/Friends/Extend/XenForo/ControllerPublic/Member.php:83
Generated By: admin, 1 minute ago
 
I think it's ridicoulus that Jon doesn't seem to care about the problems with the performance. I'm the one who paid for the first development of this AddOn and my board has around 75k users. It sucks that it's just a matter of money, since i've expected a flawless AddOn in the first place. :mad:
 
Ok, maybe you're right! I'm so sorry that i didn't mention that speed and performance is important for me. My bad... :censored:
 
If you find that the requirements do not quite fit your own, you are encouraged to donate or contribute directly so that new features can be added. In this case, an option could quite easily be added to the control panel to auto-follow upon a friend request being made -- but only if the development costs are paid for!

@Waindigo I can pay for this.
1) friends need to automatically follow each other.
2) of course, no need to follow before friend(Ing).
3) performance improvement.

Please PM me Paypal and costs to send it to you.

Thanks
 
Last edited:
@Waindigo
How to add Friend directly from Member List page
Is there a simple line of code that we can insert in a template?

Thanks a lot!

upload_2014-11-15_13-13-41.webp
 

Attachments

  • upload_2014-11-16_15-10-26.webp
    upload_2014-11-16_15-10-26.webp
    9.7 KB · Views: 122
Last edited:
It's the same performance issue everyone else has, i guess.

If you're visiting someones profile who has a lot of friends (for example 50), the query for showing the mutual friends is running almost 7 seconds (on my extra DB / Percona server).

It's this query which is causing the problem:

SELECT friend.*, user.*, mutual_friend.friend_state AS mutual_friend_state
FROM xf_friend AS friend
INNER JOIN xf_user AS user
ON (((user.user_id = friend.user_id AND friend.user_id != ?)
OR (user.user_id = friend.friend_user_id AND friend.friend_user_id != ?)) AND user.is_banned = 0)
LEFT JOIN xf_friend AS mutual_friend
ON ((user.user_id = mutual_friend.user_id AND mutual_friend.friend_user_id = ?)
OR (user.user_id = mutual_friend.friend_user_id AND mutual_friend.user_id = ?))
WHERE (friend.user_id = ? OR friend.friend_user_id = ?)
AND friend.friend_state = 'confirmed'
 
Have the performance issues been resolved yet?
No, it still very slow with big board, I had sent a donate to optimize it but Waindigo said "other add-ons are still taking priority at the moment, sorry. You are the only one who has donated for this, so it puts it towards the back of a long queue."
 
Last edited:
I think that when @Crazy-Achmet paid waindigo to create this addon he expected the addon to work on his big board.

Anyway, I intent to hire a qualified developer to create a friends addon. Anyone who wants to join can contact me.
 
Back
Top Bottom