I feel like I might just be out of luck but wondering if there’s some way to make this not so slow
Refreshing the activity page and within 1 second there are 20 activites loaded in the stream.
Adding this meta_query makes the wait time a solid 5 seconds.
QUERY: Array
(
[type] => activity_update,created_group,new_avatar
[action] => activity_update,created_group,new_avatar
[populate_extras] => false
[per_page] => 2
[meta_query] => Array
(
[0] => Array
(
[key] => flagged_by_user_id
[compare] => NOT EXISTS
)
)
)
It’s just checking if the activity has been “flagged”, and if there is a value it has been, so it should not be shown.
(Even if I reduce per_page=2 it’s still the same amount of slow)
Oddly, if I change it to “EXISTS” it’s very speedy. Only difference because only a few posts have that particular meta_key applied to them. I don’t understand why this is though because regardless if the key exists or not, the DB query check has to be performed. So why is it faster?