Re: Hash join in 8.3 - Mailing list pgsql-general

From Gregory Stark
Subject Re: Hash join in 8.3
Date
Msg-id 87hcimnv8n.fsf@oxford.xeocode.com
Whole thread Raw
In response to Re: Hash join in 8.3  (André Volpato<andre.volpato@ecomtecnologia.com.br>)
List pgsql-general
André Volpato <andre.volpato@ecomtecnologia.com.br> writes:

> Gregory Stark escreveu:
>> André Volpato <andre.volpato@ecomtecnologia.com.br> writes:
>>
>> I think the answer is that if you have bad statistics you'll get a bad plan
>> and which bad plan is going to be pretty much random.
>>
> I believe the statistics are ok, I´ve runned vacuum analyze before all those
> tries.

Sorry, I should have said "bad estimates". That is, because of the

  j*1.5 BETWEEN 3000000 AND 4000000

clause the optimizer isn't going to be able to come up with a good estimate of
how many rows that will match. What plan it picks when it has such a bad
estimate is going to be pretty random, dependant on just what plans would be
good in a situation entirely unrelated to the reality.

--
  Gregory Stark
  EnterpriseDB          http://www.enterprisedb.com
  Ask me about EnterpriseDB's Slony Replication support!

pgsql-general by date:

Previous
From: André Volpato
Date:
Subject: Re: Hash join in 8.3
Next
From: Reg Me Please
Date:
Subject: Re: COPY speedup