Artem Tomyuk wrote:
> The questions is how to avoid creating temp files on disk?
>
> The work_mem parameter set to 1600 Megabytes, but on logs i still can see the messages like:
> LOG: temporary file: path "base/pgsql_tmp/pgsql_tmp7905.2", size 865869824
Temporary files on disk are smaller than the memory required for the corresponding in-memory
operation, which explains why the size of the temporary file is less than 1600 MB.
You can either try to increase work_mem or change the query so that it does not perform
such large operations.
Yours,
Laurenz Albe