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

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

> I think I found the answer!<br>
> <br>
> 8.1: likes nested loop even after vacuumdb on the database.<br>
> <br>
> 8.3: likes hash at first time but:<br>
> - after vacuumdb *on the database* (I was running on the tables.....),
> it turns out to:<br>
>  Merge Join  (cost=178779.93..328503.44 rows=30000 width=38) in
> 20005.207 ms<br>
> #set enable_mergejoin=off;<br>
>  Hash Join  (cost=156644.00..365204.03 rows=30000 width=38) in
> 29104.390 ms<br>
>  * a very faster hash here, seqscanning the smaller table before the
> bigger one. Tricky!<br>
> <br>
> I wont trust table vacuums anymore...<br>
> <br>
> <pre class="moz-signature" cols="72">--

HTML-only mail isn't looked upon too favourably here.

You keep saying "vacuum" which makes me think maybe you're not actually
analyzing your tables at all. "vacuum" doesn't analyze the tables, you have to
run "analyze" (or "vacuum analyze") for that.

--
  Gregory Stark
  EnterpriseDB          http://www.enterprisedb.com
  Ask me about EnterpriseDB's 24x7 Postgres support!

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: extend "group by" to include "empty relations" ?
Next
From: "Merlin Moncure"
Date:
Subject: Re: COPY speedup