Improve performance of retrieving last update times for events
See 75195eefcca4cb3961986c90c8e837da02f30134 and https://gitlab.com/gitlab-org/gitlab-ce/issues/12415#note_3387317 for the juicy details.
Related issue: https://gitlab.com/gitlab-org/gitlab-ce/issues/12415