Re: Planner misestimation for JOIN with VARCHAR

From: David Rowley <dgrowleyml(at)gmail(dot)com>
To: Michael Lewis <mlewis(at)entrata(dot)com>
Cc: Sebastian Dressler <sebastian(at)swarm64(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Planner misestimation for JOIN with VARCHAR
Date: 2020-06-09 20:43:24
Message-ID: CAApHDvp+vpMSEsFf-nhmPsmjJf3yi6YV-kLqwzu9wO7uxiPFQQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, 10 Jun 2020 at 07:31, Michael Lewis <mlewis(at)entrata(dot)com> wrote:
>
> On Tue, Jun 9, 2020 at 12:34 PM Sebastian Dressler <sebastian(at)swarm64(dot)com> wrote:
>>
>> - Add an index on top of the whole PK
>> - Add indexes onto other columns trying to help the JOIN
>> - Add additional statistics on two related columns
>>
>> Another idea I had was to make use of generated columns and hash the PKs together to an BIGINT and solely use this for the JOIN. However, this would not work when not all columns of the PK are used for the JOIN.
>
>
> Can you expand on the additional statistics you created? Why was it on only two columns? Did you include MCVs type of extended stats?

Unfortunately, the join selectivity functions have yet to learn about
extended statistics.

David

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Michael Lewis 2020-06-09 21:05:05 Re: Planner misestimation for JOIN with VARCHAR
Previous Message Adrian Klaver 2020-06-09 20:24:27 Re: Something else about Redo Logs disappearing