Right now Actions has an index on (source_uid, status, type, created_at). But the common query used by Actions.js,
SELECT * FROM `Actions` WHERE `Actions`.`status`='pending' AND `Actions`.`source_uid`='XXXX' ORDER BY createdAt ASC LIMIT 100;
doesn't include a type, and so this query is expensive for users with many non-pending Actions. Add a new index on (source_uid, status, created_at) and delete the old one. This should also decrease index size.
Right now Actions has an index on (source_uid, status, type, created_at). But the common query used by Actions.js,
doesn't include a type, and so this query is expensive for users with many non-pending Actions. Add a new index on (source_uid, status, created_at) and delete the old one. This should also decrease index size.