Re: query plan question, nested loop vs hash join

From: Andrey Lizenko <lizenko79(at)gmail(dot)com>
To: Marti Raudsepp <marti(at)juffo(dot)org>
Cc: "pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org>
Subject: Re: query plan question, nested loop vs hash join
Date: 2014-10-08 09:48:35
Message-ID: CADKuZZA-92M7h6YwGwV-HUSZ2eO8tYV9CYFA0ZC=0z6By3KqbQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Thanks for your reply, Marti, as I answered to Tom couple of days ago
adjusting of 'effective_cache_size' to 80% of RAM and 'random_page_cost'
from 2 to 1 helped me.

On 8 October 2014 00:26, Marti Raudsepp <marti(at)juffo(dot)org> wrote:

> On Fri, Oct 3, 2014 at 6:38 PM, Andrey Lizenko <lizenko79(at)gmail(dot)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
>

--
С уважением, Андрей Лизенко

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Emi Lu 2014-10-08 14:22:44 char(N), varchar(N), varchar, text
Previous Message Vladimir Kamarzin 2014-10-08 08:40:23 Re: Performance degradation in 324577f39bc8738ed0ec24c36c5cb2c2f81ec660