Re: examine_variable ignored CollateExpr - Mailing list pgsql-hackers

From shihao zhong
Subject Re: examine_variable ignored CollateExpr
Date
Msg-id CAGRkXqTZjRj2x0vKFbT6pM0+-_1kvKbmSPA9HwCX_wB-BkmynA@mail.gmail.com
Whole thread
In response to examine_variable ignored CollateExpr  (jian he <jian.universality@gmail.com>)
Responses Re: examine_variable ignored CollateExpr
List pgsql-hackers
Hi Jian,

With v1 or v4 I get a worse estimate when the table has no
statistics object.

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

On master I get
  Seq Scan on t  (cost=0.00..89.00 rows=100 width=2)
With v1 or v4 I get
  Seq Scan on t  (cost=0.00..89.00 rows=26 width=2)

Could we keep the stripping, and check the statistics expressions
first only when a COLLATE was stripped from a plain column? A
table without extended statistics pays one test of rel->statlist.

Thanks,
Shihao

pgsql-hackers by date:

Previous
From: Fujii Masao
Date:
Subject: Re: REPACK (CONCURRENTLY) might keep dropped-column data
Next
From: shihao zhong
Date:
Subject: pg_resetwal: add --cluster-state option