Обсуждение: does work_mem is used on temp tables?

Поиск
Список
Период
Сортировка

does work_mem is used on temp tables?

От
Mariel Cherkassky
Дата:
Hi,
Does the work mem is used when I do sorts or hash operations on temp tables  ? Or the temp_buffer that is allocated at the beginning of the session is used for it ?

At one of our apps, the app create a temp table and run on it some operations (joins,sum,count,avg ) and so on.. I saw in the postgresql.conf that fs temp files are generated so I guested that the memory buffer that was allocated for that session was too small. The question is should I increase the work_mem or the temp_buffers ?

Thanks , Mariel.

Re: does work_mem is used on temp tables?

От
Andrew Gierth
Дата:
>>>>> "Mariel" == Mariel Cherkassky <mariel.cherkassky@gmail.com> writes:

 Mariel> Hi,
 Mariel> Does the work mem is used when I do sorts or hash operations on
 Mariel> temp tables ? Or the temp_buffer that is allocated at the
 Mariel> beginning of the session is used for it ?

work_mem is used for sorts and hashes regardless of what type the
underlying table (if any) is.

temp_buffers is used to buffer the actual _content_ of temp tables.

-- 
Andrew (irc:RhodiumToad)


Re: does work_mem is used on temp tables?

От
Andrew Gierth
Дата:
>>>>> "Mariel" == Mariel Cherkassky <mariel.cherkassky@gmail.com> writes:

 Mariel> Hi,
 Mariel> Does the work mem is used when I do sorts or hash operations on
 Mariel> temp tables ? Or the temp_buffer that is allocated at the
 Mariel> beginning of the session is used for it ?

work_mem is used for sorts and hashes regardless of what type the
underlying table (if any) is.

temp_buffers is used to buffer the actual _content_ of temp tables.

-- 
Andrew (irc:RhodiumToad)


Re: does work_mem is used on temp tables?

От
Mariel Cherkassky
Дата:
great, thanks !

‫בתאריך יום ה׳, 11 באוק׳ 2018 ב-10:42 מאת ‪Andrew Gierth‬‏ <‪andrew@tao11.riddles.org.uk‬‏>:‬
>>>>> "Mariel" == Mariel Cherkassky <mariel.cherkassky@gmail.com> writes:

 Mariel> Hi,
 Mariel> Does the work mem is used when I do sorts or hash operations on
 Mariel> temp tables ? Or the temp_buffer that is allocated at the
 Mariel> beginning of the session is used for it ?

work_mem is used for sorts and hashes regardless of what type the
underlying table (if any) is.

temp_buffers is used to buffer the actual _content_ of temp tables.

--
Andrew (irc:RhodiumToad)

Re: does work_mem is used on temp tables?

От
Mariel Cherkassky
Дата:
great, thanks !

‫בתאריך יום ה׳, 11 באוק׳ 2018 ב-10:42 מאת ‪Andrew Gierth‬‏ <‪andrew@tao11.riddles.org.uk‬‏>:‬
>>>>> "Mariel" == Mariel Cherkassky <mariel.cherkassky@gmail.com> writes:

 Mariel> Hi,
 Mariel> Does the work mem is used when I do sorts or hash operations on
 Mariel> temp tables ? Or the temp_buffer that is allocated at the
 Mariel> beginning of the session is used for it ?

work_mem is used for sorts and hashes regardless of what type the
underlying table (if any) is.

temp_buffers is used to buffer the actual _content_ of temp tables.

--
Andrew (irc:RhodiumToad)