Re: How to craft a query that uses memory?

Поиск
Список
Период
Сортировка
От Scott Marlowe
Тема Re: How to craft a query that uses memory?
Дата
Msg-id CAOR=d=3S6hG3Fvk76=Z=YdxY0hKtKmc+9En+cTcm_H-m-UcrTQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: How to craft a query that uses memory?  (<Holger.Friedrich-Fa-Trivadis@it.nrw.de>)
Список pgsql-general
Note that after cranking up work mem you then need a query that can
use it. Quickest way to use LOTS of memory is to do a lot of
unconstrained joins.

select * from table a join table b on (true) join table c on (true)
join table d on (true); Result set is size of a*b*c*d

On Fri, Jun 19, 2015 at 7:21 AM,
<Holger.Friedrich-Fa-Trivadis@it.nrw.de> wrote:
> Albe Laurenz wrote on Friday, June 19, 2015 12:56 PM:
>> Holger Friedrich wrote:
>> > So how do I craft a query that actually does use lots of memory?
>
>> You increase the parameter "work_mem".
>
>> You can do that globally in postgresql.conf or with SET for one session or with SET LOCAL for one transaction.
>
> Thank you to both Albe Laurenz and Andreas Kretschmer, who both gave the same advice.  It was spot-on:  my query
actuallyseems to be good for a performance study, setting work_mem to various values causes the query planner to either
sortin memory or on disk, and of course this has some impact on performance. 
>
> (Sorry for erroneously asking for suggesting a "better" query, rather than for tuning my configuration, which turned
outto be the sensible thing to do...) 
>
> Best regards,
> Holger Friedrich
>
> --
> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general



--
To understand recursion, one must first understand recursion.


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

Предыдущее
От: Daniel Begin
Дата:
Сообщение: Re: Planner cost adjustments
Следующее
От: Piotr Gackiewicz
Дата:
Сообщение: Re: pg_dump 8.4.9 failing after upgrade to openssl-1.0.1e-30.el6_6.11.x86_64 on redhat linux