Re: using extended statistics to improve join estimates - Mailing list pgsql-hackers

From Andy Fan
Subject Re: using extended statistics to improve join estimates
Date
Msg-id 87cyr89nk5.fsf@163.com
Whole thread Raw
In response to Re: using extended statistics to improve join estimates  (Justin Pryzby <pryzby@telsasoft.com>)
Responses Re: using extended statistics to improve join estimates  (Tomas Vondra <tomas.vondra@enterprisedb.com>)
Re: using extended statistics to improve join estimates  (Justin Pryzby <pryzby@telsasoft.com>)
List pgsql-hackers
> On Wed, Mar 02, 2022 at 11:38:21AM -0600, Justin Pryzby wrote:
>> Rebased over 269b532ae and muted compiler warnings.

Thank you Justin for the rebase!

Hello Tomas,

Thanks for the patch! Before I review the path at the code level, I want
to explain my understanding about this patch first.

Before this patch, we already use MCV information for the eqjoinsel, it
works as combine the MCV on the both sides to figure out the mcv_freq
and then treat the rest equally, but this doesn't work for MCV in
extended statistics, this patch fill this gap. Besides that, since
extended statistics means more than 1 columns are involved, if 1+
columns are Const based on RestrictInfo, we can use such information to
filter the MCVs we are interesting, that's really cool. 

I did some more testing, all of them are inner join so far, all of them
works amazing and I am suprised this patch didn't draw enough
attention. I will test more after I go though the code.

At for the code level, I reviewed them in the top-down manner and almost
40% completed. Here are some findings just FYI. For efficiency purpose,
I provide each feedback with a individual commit, after all I want to
make sure my comment is practical and coding and testing is a good way
to archive that. I tried to make each of them as small as possible so
that you can reject or accept them convinently.

0001 is your patch, I just rebase them against the current master. 0006
is not much relevant with current patch, and I think it can be committed
individually if you are OK with that.

Hope this kind of review is helpful.

-- 
Best Regards
Andy Fan


Attachment

pgsql-hackers by date:

Previous
From: Andy Fan
Date:
Subject: Re: [HACKERS] make async slave to wait for lsn to be replayed
Next
From: Bertrand Drouvot
Date:
Subject: Re: Synchronizing slots from primary to standby