The query i’m using is:
SELECT changes.user_id, changes.changename, changes.date, changes.link, changes.changetype
FROM changes, friends
WHERE (friends.user_id=SOMEID AND friends.user_id=changes.user_id) OR (friends.user_id2=SOMEID AND friends.user_id2=changes.user_id) AND changes.date>SOMEDATE
GROUP BY changes.change_id
ORDER BY changes.date DESC
LIMIT 0, 10
This query will list a set of changes made by a user, or one of their listed friends (sort of like a mini-feed in Facebook).
When I run an explain on the query I get the output shown in the file attached.
The table ‘changes’ currently has around 180,000 rows (60,000 additional rows get added a month on average - table is 3 months old). So the table is very large, but this is the nature of the table and what it’s meant to do. That’s why im using the date to limit how much is fetched.
The iamge attached also has the table structures