Re: ERROR: corrupt MVNDistinct entry

2025-01-02 Thread Richard Guo
On Tue, Dec 31, 2024 at 5:40 PM Richard Guo wrote: > Regarding the back-patch, this patch is a bug fix, which suggests it > should be back-patched. However, it also changes some plans by fixing > the cost estimation. Does anyone know what our usual approach is in > this situation? Although this

Re: ERROR: corrupt MVNDistinct entry

2024-12-31 Thread Richard Guo
On Fri, Dec 27, 2024 at 1:16 PM Richard Guo wrote: > I'm wondering if we also need to strip out the nullingrels from the > expression in examine_variable(). I tried doing so and noticed a plan > diff in regression test join.sql. Here is an updated patch that implements this change, and also move

Re: ERROR: corrupt MVNDistinct entry

2024-12-26 Thread Richard Guo
On Wed, Dec 25, 2024 at 6:36 PM Richard Guo wrote: > In v16 and later, the nullingrels within the expression "t2.a + t2.b" > prevent it from being matched to the corresponding expression in > extended statistics, forcing us to use DEFAULT_UNK_SEL(0.005). Furthermore, even without extended statist

Re: ERROR: corrupt MVNDistinct entry

2024-12-25 Thread Andrei Lepikhov
On 25/12/2024 16:36, Richard Guo wrote: On Wed, Dec 25, 2024 at 5:14 PM Richard Guo wrote: On Wed, Dec 25, 2024 at 11:34 AM Andrei Lepikhov wrote: 2. It is ok for Vars. But what about expressions? We use equal() in distinct, MCV and dependencies modules. Do we need to remove nulls before usin

Re: ERROR: corrupt MVNDistinct entry

2024-12-25 Thread Richard Guo
On Wed, Dec 25, 2024 at 5:14 PM Richard Guo wrote: > On Wed, Dec 25, 2024 at 11:34 AM Andrei Lepikhov wrote: > > 2. It is ok for Vars. But what about expressions? We use equal() in > > distinct, MCV and dependencies modules. Do we need to remove nulls > > before using extended statistics as a gen

Re: ERROR: corrupt MVNDistinct entry

2024-12-25 Thread Richard Guo
On Wed, Dec 25, 2024 at 11:34 AM Andrei Lepikhov wrote: > I have a couple of notes. > 1. The nulling_relids provides us sensible information about possible > nulls inside the input. We are not using it to estimate the number of > such nulls for now. Does Your idea consist of obtaining 'clear' > st

Re: ERROR: corrupt MVNDistinct entry

2024-12-24 Thread Richard Guo
On Tue, Dec 24, 2024 at 5:00 PM Richard Guo wrote: > It seems to me that when estimating the number of groups, we do not > need to concern ourselves with the outer joins that could null the > Vars/PHVs contained in the grouping expressions, and we should not > count the same Var more than once. F

Re: ERROR: corrupt MVNDistinct entry

2024-12-24 Thread Andrei Lepikhov
On 12/24/24 15:00, Richard Guo wrote: Any thoughts? I have a couple of notes. 1. The nulling_relids provides us sensible information about possible nulls inside the input. We are not using it to estimate the number of such nulls for now. Does Your idea consist of obtaining 'clear' statistics

ERROR: corrupt MVNDistinct entry

2024-12-24 Thread Richard Guo
t2) s on true group by s.c1, s.c2; ERROR: corrupt MVNDistinct entry And the first bad commit is: 2489d76c4906f4461a364ca8ad7e0751ead8aa0d is the first bad commit commit 2489d76c4906f4461a364ca8ad7e0751ead8aa0d Author: Tom Lane Date: Mon Jan 30 13:16:20 2023 -0500 Make Vars be outer-join