What is the value of guc constrain_exclusion ?
pgsql-performance by date:
Соглашаюсь с условиями обработки персональных данных