Optimal selection of secondary indexes