On Thu, Aug 13, 2015 at 2:49 AM, Kouhei Kaigai <kaigai(at)ak(dot)jp(dot)nec(dot)com> wrote:
> In fact, cost of HashJoin underlying Sort node is:
> -> Hash Join (cost=621264.91..752685.48 rows=1 width=132)
>
> On the other hands, NestedLoop on same place is:
> -> Nested Loop (cost=0.00..752732.26 rows=1 width=132)
>
> Probably, small GUC adjustment may make optimizer to prefer HashJoin towards
> these kind of queries.
With that kind of discrepancy I doubt adjusting GUCs will be sufficient
> Do you have a good idea?
Do you have EXPLAIN ANALYZE from the plan that finishes? Are there any
row estimates that are way off?
--
greg