| From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
|---|---|
| To: | Chengpeng Yan <chengpeng_yan(at)outlook(dot)com> |
| Cc: | PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Jeff Davis <pgsql(at)j-davis(dot)com> |
| Subject: | Re: [PATCH] Fix encoding-dependent LIKE/regex selectivity estimates |
| Date: | 2026-11-19 18:45:46 |
| Message-ID: | 1059497.1795113946@sss.pgh.pa.us |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
While trying to test this patch, I was reminded that this logic is
pretty much of a backwater, which likely explains why we've not
gotten more complaints about it. The only code that actually
consumes these pattern-analysis estimates is in patternsel_common(),
and it only uses them if (1) the clause being considered is of the
form "Var Op Const" but (2) we don't have a histogram of at least
100 entries for the Var. I think case (2) is pretty few and far
between in modern Postgres usage; moreover, you have to have a
good deal fewer than 100 entries before we rely heavily on the
estimate rather than the histogram-derived selectivity.
So TBH I'm wondering if this code is worth putting a lot of effort
into, as opposed to just nuking it all from orbit and using some
default number when we lack any histogram. Did your interest in it
stem from any bad real-world experience, and if so what did that
use-case look like?
regards, tom lane
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Masahiko Sawada | 2026-11-19 18:46:04 | Re: Use an index scan in RemoveSubscriptionRel() |
| Previous Message | Tomas Vondra | 2026-11-19 18:28:34 | Re: A bug in recovery prefetcher, triggering asserts / FATAL: checkpoint request failed |