MDL-46573 gradereport_history: Cross DB query relying on timemodified