check the max number of indices needed.