Re: Ambigous Plan - Larger Table on Hash Side

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Narendra Pradeep U U <narendra(dot)pradeep(at)zohocorp(dot)com>
Cc: "pgsql-hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Ambigous Plan - Larger Table on Hash Side
Date: 2018-03-12 16:52:00
Message-ID: 9257.1520873520@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Narendra Pradeep U U <narendra(dot)pradeep(at)zohocorp(dot)com> writes:
> Recently I came across a case where the planner choose larger table on hash side. I am not sure whether it is an intended behavior or we are missing something.

Probably the reason is that the smaller table has a less uniform
distribution of the hash key. You don't want to hash with a nonuniform
distribution of the hashtable key; if many keys go into the same bucket
then performance degrades drastically.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Mat Arye 2018-03-12 17:03:57 Additional Statistics Hooks
Previous Message Tom Lane 2018-03-12 16:43:20 Re: Cast jsonb to numeric, int, float, bool