Re: INDEX and JOINs

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Reg Me Please <regmeplease(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: INDEX and JOINs
Date: 2007-10-26 13:18:04
Message-ID: 11506.1193404684@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Reg Me Please <regmeplease(at)gmail(dot)com> writes:
>>> (cost=3.95..382140.91 rows=274709 width=91) (actual
>>> time=1.929..57713.305 rows=92 loops=1)
>>> Hash Cond: (t_dati.camp_id = t_campi.camp_id)

I think the reason it doesn't want to use an indexed join is the large
estimate of the number of join result rows. You need to try to get that
number down to something nearer the reality. Increasing the statistics
target for the larger table might help.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Gregory Stark 2007-10-26 13:21:39 Re: select count() out of memory
Previous Message Martijn van Oosterhout 2007-10-26 13:02:21 Re: INDEX and JOINs