pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Dan Harris <fbsd@drivefaster.net>
To: pgsql-performance@postgresql.org
Subject: Re: Fwd: Help with view performance problem
Date: Thu, 28 Jul 2005 10:14:32 -0600
Message-ID: <B0A387FA-9B74-4DB9-9C9F-C8291965A55F@drivefaster.net> (raw)
In-Reply-To: <1d219a6f0507280738791f0ea3@mail.gmail.com>
References: <1d219a6f05072708122cf6abeb@mail.gmail.com>
	<1d219a6f050727092927746db1@mail.gmail.com>
	<1d219a6f0507280738791f0ea3@mail.gmail.com>


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



view thread (5+ messages)  latest in thread

Message-ID: <B0A387FA-9B74-4DB9-9C9F-C8291965A55F@drivefaster.net>
Permalink:  ../B0A387FA-9B74-4DB9-9C9F-C8291965A55F@drivefaster.net/
Also on:    postgresql.org/message-id/B0A387FA-9B74-4DB9-9C9F-C8291965A55F@drivefaster.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: fbsd@drivefaster.net, pgsql-performance@postgresql.org
  Subject: Re: Fwd: Help with view performance problem
  In-Reply-To: <B0A387FA-9B74-4DB9-9C9F-C8291965A55F@drivefaster.net>
  References: <1d219a6f05072708122cf6abeb@mail.gmail.com> <1d219a6f050727092927746db1@mail.gmail.com> <1d219a6f0507280738791f0ea3@mail.gmail.com> <B0A387FA-9B74-4DB9-9C9F-C8291965A55F@drivefaster.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox