improve last galaxy query for dashboard view performance