Re: 9.2.4 vs 9.3.0 query planning (sort merge join vs hash join)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Tim Kane <tim(dot)kane(at)gmail(dot)com>
Cc: "pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org>
Subject: Re: 9.2.4 vs 9.3.0 query planning (sort merge join vs hash join)
Date: 2014-05-12 11:23:00
Message-ID: 17739.1399893780@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Tim Kane <tim(dot)kane(at)gmail(dot)com> writes:
> Is there a propensity for 9.2.4 to prefer a sort-merge-join, in place of a
> hash join?

Not particularly; I don't think there's any actual difference in the cost
estimation equations between 9.2 and 9.3. The two plans you show are
close enough in estimated cost that the ordering of their costs might be
coming out differently just as a matter of random variation in statistics.

It'd be worth double-checking the work_mem setting on both systems,
though, as (IIRC) an undersized work_mem hurts the estimate for hashes
more than for sorts.

regards, tom lane

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Tim Kane 2014-05-12 12:22:51 Re: 9.2.4 vs 9.3.0 query planning (sort merge join vs hash join)
Previous Message Tim Kane 2014-05-12 10:45:20 9.2.4 vs 9.3.0 query planning (sort merge join vs hash join)