added index for batch and Id to speed up select statement