sort_mem is just a convenience alias for work_mem.
pgsql-general by date:
Соглашаюсь с условиями обработки персональных данных