Re: query plan question, nested loop vs hash join - Mailing list pgsql-performance

From Marti Raudsepp
Subject Re: query plan question, nested loop vs hash join
Date
Msg-id CABRT9RCqFzidSEADW5TeNhZxNaVCtabJhOtJfr-aOHqWGTJcsg@mail.gmail.com
Whole thread Raw
In response to query plan question, nested loop vs hash join  (Andrey Lizenko <lizenko79@gmail.com>)
Responses Re: query plan question, nested loop vs hash join
List pgsql-performance
On Fri, Oct 3, 2014 at 6:38 PM, Andrey Lizenko <lizenko79@gmail.com> wrote:
> Is it possible to force optimizer choose the second plan without doing  "set
> enable_hashjoin = off;" ?
>
> Increasing  of 'effective_cache_size' leads to similar thing with mergejoin,
> other options (work_mem, shared_buffers. etc) do not change anything.

Have you tried changing random_page_cost?

In small databases where most of the data is cached anyway, lowering
random_page_cost to somewhere between 1 and 2 usually leads to better
planner decisions.

Regards,
Marti


pgsql-performance by date:

Previous
From: Mike Blackwell
Date:
Subject: Re: pg_basebackup - odd performance
Next
From: Sergey Konoplev
Date:
Subject: Re: help: function failing