Re: Indices arent being used

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: rantunes(at)student(dot)dei(dot)uc(dot)pt
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Indices arent being used
Date: 2003-09-27 17:14:02
Message-ID: 6354.1064682842@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

rantunes(at)student(dot)dei(dot)uc(dot)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

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Richard Jones 2003-09-27 17:24:33 advice on raid controller
Previous Message rantunes 2003-09-27 14:48:58 Re: Indices arent being used