Re: Odd out of memory problem.
| От | Tom Lane |
|---|---|
| Тема | Re: Odd out of memory problem. |
| Дата | |
| Msg-id | 25811.1332775106@sss.pgh.pa.us обсуждение |
| Ответ на | Odd out of memory problem. (Andrew Dunstan <andrew@dunslane.net>) |
| Ответы |
Re: Odd out of memory problem.
|
| Список | pgsql-hackers |
Andrew Dunstan <andrew@dunslane.net> writes:
> I'm really perplexed as to why this fairly simple query should cause an
> out of memory error:
> select loid, max(pageno) from ldata group by loid order by 2 desc
> limit 10;
Looks like the group by/aggregate step is eating lots of memory:
> AggContext: 864018432 total in 127 blocks; 3400 free (110
> chunks); 864015032 used
> TupleHashTable: 619175960 total in 95 blocks; 821528 free
> (331 chunks); 618354432 used
A guess is that there are a huge number of distinct values of "loid" but
the planner fails to realize that and tries to use a hash aggregation.
Could we see EXPLAIN output for this query?
regards, tom lane
В списке pgsql-hackers по дате отправления: