Pg_gather found our default work_mem is too high
Apparently we should be tuning work_mem based on individual queries. More on why and how to do this tuning can be found here: https://aws.amazon.com/blogs/database/tune-sorting-operations-in-postgresql-with-work_mem/#:~:text=Apart%20from%20helping%20sorts%2C%20work_mem%20is%20also,most%20common%20reasons%20for%20using%20work_mem%20.