Get rid of unnecessary distinct operator