On 15/12/2023 15:58, Richard Guo wrote:
> With the patch the estimate for the number of distinct 'b' values is
> more accurate.
+1 to commit this patch.
It looks good and resolves kind of a bug in the code.
>
> BTW, this patch does not change any existing regression test results. I
> attempted to devise a regression test that shows how this change can
> improve query plans, but failed. Should I try harder to find such a
> test case?
The test that was changed refers to different features. Its behaviour
can be changed in. the future, and mask testing of this code. IMO, you
should add a test directly checking appendrel->tuples correction.
--
regards,
Andrei Lepikhov
Postgres Professional