Adjust ndistinct for eqjoinsel - Mailing list pgsql-hackers

From Zhenghua Lyu
Subject Adjust ndistinct for eqjoinsel
Date
Msg-id CO6PR05MB750605D9F88AAFFB95658BABB58B9@CO6PR05MB7506.namprd05.prod.outlook.com
Whole thread Raw
Responses Re: Adjust ndistinct for eqjoinsel
List pgsql-hackers
Hi,
    I run TPC-DS benchmark for Postgres and find the join size estimation has several problems.
    For example, Ndistinct is key to join selectivity's estimation, this value does not take restrictions
    of the rel, I hit some cases in the function eqjoinsel, nd is much larger than vardata.rel->rows.
   
    Accurate estimation need good math model that considering dependency of join var and vars in restriction.
    But at least, indistinct should not be greater than the number of rows. 

    See the attached patch to adjust nd in eqjoinsel.

Best,
Zhenghua Lyu
Attachment

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Allowing REINDEX to have an optional name
Next
From: "David G. Johnston"
Date:
Subject: Re: Doc about how to set max_wal_senders when setting minimal wal_level