What does "explain analyze select.... (your query here)" have to say?
pgsql-general by date:
Соглашаюсь с условиями обработки персональных данных