Join message data in one query for performance.