Re: Explicit deterministic COLLATE fails with pattern matching operations on column with non-deterministic collation

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: James Lucas <jlucasdba@gmail.com>
Cc: PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Date: 2020-05-28T20:48:00Z
Lists: pgsql-bugs
James Lucas <jlucasdba@gmail.com> writes:
> So that is something to be aware of - the collation defined on the
> column can impact stats values, which could in turn impact plans
> chosen for queries that use alternative collations.

Yeah.  At some point we might try to collect stats with respect to
multiple collations, but that's a long way off probably.

(I have suggested that CREATE STATISTICS could be extended to
control this type of thing, but I don't think anyone's worked
on making it happen.)

			regards, tom lane



Commits

  1. Improve ineq_histogram_selectivity's behavior for non-default orderings.

  2. Use query collation, not column's collation, while examining statistics.

  3. Make pg_statistic and related code account more honestly for collations.