Re: Massive memory use for star query

Поиск
Список
Период
Сортировка
От Greg Stark
Тема Re: Massive memory use for star query
Дата
Msg-id BANLkTi=_qXQi2D=qSNhd+mRkHZ-r6k8Qpw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Massive memory use for star query  (Mark Kirkwood <mark.kirkwood@catalyst.net.nz>)
Ответы Re: Massive memory use for star query  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
On Sat, Apr 16, 2011 at 8:21 AM, Mark Kirkwood
<mark.kirkwood@catalyst.net.nz> wrote:
>
> I guess you have answered my first question - i.e yes this should eat
> massive amount of ram as written - however are you sure there is no memory
> leaking going on here?

The planner doesn't try to free up memory while it's working, it
generally assumes that producing a plan is a short process and when
it's done it'll free the whole context and that's enough.

The basic problem is that the number of possible plans blows up
combinatorically. That is with 14 tables there are 14! possible join
orderings and more something like 3^(14!) possible join strategies --
actually more if you include things like whether to materialize and
which keys to use and so on.

The planner uses various heuristics to avoid combinatoric growth
wherever it can but there's no way to completely avoid it.
--
greg

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Mark Kirkwood
Дата:
Сообщение: Re: Massive memory use for star query
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Massive memory use for star query