Remove usage of distinct() on a text column (not supported by all databases).