Re: Fwd: Help with view performance problem - Mailing list pgsql-performance

From Dan Harris
Subject Re: Fwd: Help with view performance problem
Date
Msg-id B0A387FA-9B74-4DB9-9C9F-C8291965A55F@drivefaster.net
Whole thread Raw
In response to Fwd: Help with view performance problem  (Chris Hoover <revoohc@gmail.com>)
Responses Re: Fwd: Help with view performance problem  (Chris Hoover <revoohc@gmail.com>)
List pgsql-performance
On Jul 28, 2005, at 8:38 AM, Chris Hoover wrote:
>
>
> I did some more testing, and ran the explain analyze on the problem.
> In my session I did a set enable_hashjoin = false and then ran the
> analyze.  This caused it to use the indexes as I have been expecting
> it to do.
>
> Now, how can I get it to use the indexes w/o manipulating the
> environment?  What make postgresql want to sequentially scan and use a
> hash join?
>
> thanks,
>
> Chris
>
> explain analyze with set_hashjoin=false;
> prob_db=#explain analyze select * from clm_com;
>
>

I had something similar to this happen recently.  The planner was
choosing a merge join and seq scan because my 'random_page_cost' was
set too high.  I had it at 3 , and ended up settling at 1.8 to get it
to correctly use my indices.  Once that change was in place, the
planner did the 'right' thing for me.

Not sure if this will help you, but it sounds similar.

-Dan

pgsql-performance by date:

Previous
From: Chris Hoover
Date:
Subject: Fwd: Help with view performance problem
Next
From: Steven Rosenstein
Date:
Subject: Unable to explain DB error