| От | Tom Lane |
|---|---|
| Тема | Re: "union all" query consumes all memory |
| Дата | |
| Msg-id | 32507.1384468843@sss.pgh.pa.us обсуждение |
| Ответ на | "union all" query consumes all memory (Pavel Stehule <pavel.stehule@gmail.com>) |
| Список | pgsql-hackers |
Pavel Stehule <pavel.stehule@gmail.com> writes:
> one my customer reported a "out of memory" issue. After investigation he
> found a main problem in large query that uses a lot of union all queries.
> He wrote a self test:
> do $$
> declare i integer; str text='';
> begin
> for i in 1..1000 loop
> str := str || 'union all select i,i,i from generate_series(1,50000) g(i) ';
> end loop;
> execute 'select 1,2,3 ' || str;
> end;
> $$
> is it expected behave?
Well, that query is entitled to use 1000 * work_mem for the
generate_series output tuplestores. What's your work_mem setting?
Perhaps more to the point, what was your customer doing?
regards, tom lane
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера