do you have any indexes on that table ?
pgsql-performance by date:
Соглашаюсь с условиями обработки персональных данных