Hi Matheus,
> The attached patch fixes this by also stripping the grouping step's RT
> index wherever selfuncs.c already strips the outer join nullingrels
> before looking up statistics.
I reviewed v1. It applies cleanly and the tests pass. Your analysis
matches what I see. The three new cases do fail with "corrupt
MVNDistinct entry" without the fix.
However, only add_unique_group_var() is covered. If I revert the
examine_variable() and estimate_multivariate_bucketsize() but keep the
tests, the whole regression suite still passes.
--
Best regards,
Aleksander Alekseev