Currently in GetTrackingCatalogs, we fetch a list of catalogs then according to each one's latest event ID query postgresql again to fetch corresponding event.
We should optimize this workflow by joining two tables at first, thus saving additional queries.