speed up this query.
add some indexes for the transactions table so the retention stats work better