optimizing message report queries