Hi,

I have applied the proposed patch and tested the issue related to incorrect
selectivity estimates for NOT on nullable Boolean columns.

I first reproduced the issue before applying the patch. The test table
contained 10,000 rows (7,000 NULL, 2,000 TRUE, and 1,000 FALSE values).

Before applying the patch:

   -

   Estimated rows: 8,000
   -

   Actual rows: 1,000

After applying the patch, I rebuilt and tested PostgreSQL using the same
data and query.

After applying the patch:

   -

   Estimated rows: 1,000
   -

   Actual rows: 1,000
   -

   Rows removed by filter: 9,000
   -

   Execution time: 0.803 ms

I also tested cases with no NULL values, only NULL values, and without
ANALYZE statistics.

All  regression tests passed, and git diff --check reported no issues.

The estimated row count now matches the actual row count in the main test
case.

Regards
solai

Reply via email to