ALTER TABLE core_notify ADD INDEX lookup(act_when, msgid);
ALTER TABLE core_notify ADD INDEX lookup_a(onid, ontable, person_id, act_when, msgid, to_email);
alter table core_notify add INDEX lookup_b (sent, person_id, msgid, ontable);
ALTER TABLE core_notify ADD INDEX lookup(act_when, msgid);
ALTER TABLE core_notify ADD INDEX lookup_a(onid, ontable, person_id, act_when, msgid, to_email);
alter table core_notify add INDEX lookup_b (sent, person_id, msgid, ontable);