hELLO

An LLM-based tetsing of the patch found that while the patch improves
some cases, it also causes at least two regressions:

1. DISTINCT with 100% true 50% not true

CREATE TABLE t AS SELECT true AS a, i AS b FROM
generate_series(1,10000) AS g(i);
ANALYZE t;
EXPLAIN ANALYZE WITH s AS MATERIALIZED (SELECT DISTINCT a,b FROM t)
SELECT * FROM s WHERE NOT a;
-- patched: CTE Scan on s ... rows=5000 ... actual rows=0.00
-- master:  CTE Scan on s ... rows=1    ... actual rows=0.00

2. NOT inside BooleanTest (IS FALSE / IS NOT FALSE) regresses on
nullable booleans

CREATE TABLE t (id int, deleted boolean) WITH (autovacuum_enabled = off);
INSERT INTO t
SELECT i, CASE WHEN i <= 9500 THEN NULL WHEN i <= 9900 THEN true ELSE false END
FROM generate_series(1, 10000) AS g(i);
ANALYZE t;
CREATE VIEW v AS SELECT id, NOT deleted AS active FROM t;

EXPLAIN ANALYZE SELECT * FROM v WHERE active IS FALSE;
-- patched: rows=9900 (actual rows=400.00)
-- master:  rows=400  (actual rows=400.00)

EXPLAIN ANALYZE SELECT * FROM v WHERE active IS NOT FALSE;
-- patched: rows=100  (actual rows=9600.00)
-- master:  rows=9600 (actual rows=9600.00)


Reply via email to