Re: examine_variable ignored CollateExpr - Mailing list pgsql-hackers

From shihao zhong
Subject Re: examine_variable ignored CollateExpr
Date
Msg-id CAGRkXqQQZPSPd6MC8iUBoBACLUGe2TAUw7+BO2yRt_J7YcfnmA@mail.gmail.com
Whole thread
In response to Re: examine_variable ignored CollateExpr  ("ZizhuanLiu X-MAN" <44973863@qq.com>)
List pgsql-hackers
Hi Zizhuan,

Thanks for v5. My example is fixed, I get rows=100 again. The
regression tests pass, and I could not measure any change in
planning time for varchar columns.

One more issue 

  CREATE TABLE t (a text);
  INSERT INTO t SELECT chr(65 + g % 52) || g
    FROM generate_series(1, 5200) g;
  CREATE STATISTICS s ON (left(a, 1) COLLATE "C") FROM t;
  ANALYZE t;
  EXPLAIN SELECT * FROM t WHERE left(a, 1) = 'A';

On master I get rows=100, with v5 I get rows=26. I think the retry
only runs when the query has the COLLATE, not when only the
statistics expression has it.

v5 also dropped the tests that v1 had. Could you add them back,
with this case and my earlier one?

Thanks,
Shihao

pgsql-hackers by date:

Previous
From: shihao zhong
Date:
Subject: Re: pg_resetwal: refuse to run when backup_label exists
Next
From: shihao zhong
Date:
Subject: Re: [PG19] Wrong results from NOT NULL-based expression simplification