I haven't come up with any great ideas for this one. It might be interesting to compare the explain analyze output from the distinct on query with and without seqscans enabled.
pgsql-performance by date:
Соглашаюсь с условиями обработки персональных данных