pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: rantunes@student.dei.uc.pt
Cc: pgsql-performance@postgresql.org
Subject: Re: Indices arent being used
Date: Sat, 27 Sep 2003 13:14:02 -0400
Message-ID: <6354.1064682842@sss.pgh.pa.us> (raw)
In-Reply-To: <200309271448.h8REmwXA008210@student.dei.uc.pt>
References: <200309271448.h8REmwXA008210@student.dei.uc.pt>

rantunes@student.dei.uc.pt writes:
> Here is the explain analyze of the query:
> explain analyze select count(*) from actvars, prodlevel where
> actvars.product_level=prodlevel.code_level and
> prodlevel.division_level='OY3S5LAPALL6';

> [ slow merge join ]

I wonder whether a hash join wouldn't work better.  Can you force a hash
join?  (Try "enable_mergejoin = 0" and if needed "enable_nestloop = 0";
don't disable seqscans though.)  If you can get such a plan, please post
the explain analyze results for it.

> This method forces the indices to work but it looks like it takes a long to
> finish executing, I had to cancel the query after 10 min.

"Force use of the indexes" is not always an answer to performance issues.

			regards, tom lane



view thread (7+ messages)

Message-ID: <6354.1064682842@sss.pgh.pa.us>
Permalink:  ../6354.1064682842@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/6354.1064682842@sss.pgh.pa.us

 · 

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-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, rantunes@student.dei.uc.pt
  Subject: Re: Indices arent being used
  In-Reply-To: <6354.1064682842@sss.pgh.pa.us>
  References: <200309271448.h8REmwXA008210@student.dei.uc.pt> <6354.1064682842@sss.pgh.pa.us>

* 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