Hi,
We are developing a site which we have one page call "news feeds" like facebook "news feeds".
In my implementation, I used follow snippet code to get the news feeds via the river table:
$activity = elgg_list_river(array(
'joins' => array("JOIN {$db_prefix}entities object ON object.guid = rv.object_guid"),
'wheres' => array("rv.object_guid IN (SELECT guid_two FROM {$db_prefix}entity_relationships WHERE guid_one=$user->guid AND relationship='enroll')
OR rv.subject_guid = $user->guid
OR rv.subject_guid IN (SELECT guid_two FROM {$db_prefix}entity_relationships WHERE guid_one=$user->guid OR guid_two=$user->guid AND relationship='classmate')
OR rv.subject_guid IN (SELECT guid_one FROM {$db_prefix}entity_relationships WHERE guid_two=$user->guid OR guid_two=$user->guid AND relationship='friend')"),
"pagination" => false));I got total time of loading time to process it about 4 seconds.
My data set is ten users who have ten status objects and each status object have ten annotation comments.When i commentted above snippet code. I got the total loading time is about 100ms second. I wonder how can I improve the loading speed or there are any other way to implement the dashboard's news feed.
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by Raül Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
- Paweł Sroka@srokap

Paweł Sroka - 0 likes
- TrungHuynh@trunghuynh

TrungHuynh - 0 likes
You must log in to post replies.I would try to change subqueries to left joins.
Apart from that I would extract SQL query you're running here and run EXPLAIN on it.
Sorry but I can't understand clear your sentence "I would try to change subqueries to left joins".
When I look into my mysql log. Elgg will call
And when I run "EXPLAIN" command there are one point that I concern is
I don't know how to improve. My team plan will add one or two more tables to remove JOINS