Now that we've got the is_resolved column and are keeping rows around longer for use in audit recon, queries that used to resolve in a few ms are taking upwards of 5 sec to come back. This will make it impractical to resolve all the pending transactions
Example query
select * from pending where gateway = 'paypal_ec' and is_resolved = 0 and payment_method in ('cc','google','paypal') order by date asc limit 1
It appears to be using idx_pending_date
create index idx_pending_date on smashpig.pending (date);
and not idx_pending_date_gateway_resolved
create index idx_pending_date_gateway_resolved on smashpig.pending (date, gateway, is_resolved);
Perhaps we should add payment_method to the larger index?