What does the output of explain select sec.* ... have to say?
pgsql-general by date:
Соглашаюсь с условиями обработки персональных данных