| From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
|---|---|
| To: | ZizhuanLiu X-MAN <44973863(at)qq(dot)com> |
| Cc: | pgsql-bugs <pgsql-bugs(at)lists(dot)postgresql(dot)org> |
| Subject: | Re: BUG #19926: Incorrect join selectivity for <> with NULLs (related to BUG #17545) |
| Date: | 2026-12-04 21:15:34 |
| Message-ID: | 2501322.1796418934@sss.pgh.pa.us |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-bugs |
"=?utf-8?B?Wml6aHVhbkxpdSBYLU1BTg==?=" <44973863(at)qq(dot)com> writes:
> I would like to summarize the scope of the proposed fix for BUG #19926
> and outline my plan for splitting it into a separate patch.
> ...
> I plan to add a helper in selfuncs.c, tentatively named neqjoinsel_semi(), based on
> distinctjoinsel_semi() in v3. It would reuse the statistics and matching logic while
> explicitly distinguishing the NULL handling for ordinary <> and IS DISTINCT FROM.
> The helper would be called from clause_selectivity_ext(), again without changing the
> existing calling interface for operator join-selectivity estimators.
I think that's quite unacceptable, because (IIUC) it provides no way
for extension operators to provide their own estimators: it's
eqjoinsel or nothing.
I do like the idea suggested in the other thread of using
fcinfo->context to extend the selectivity estimator API in a
compatible way. If you know about that, you can be smarter than
before, and if you don't know about it, you're no worse off,
and we don't have to deal with all the fallout of changing the
SQL-visible signature for estimators. We do have to think about
preserving the flexibility to extend that mechanism further in
future (ie, if the API is defined such that it can't be used
for anything beyond DistinctExpr, we made a mistake).
regards, tom lane
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Robert Haas | 2026-12-04 22:02:26 | Re: BUG #19519: REPACK can fail due to missing chunk for toast value |
| Previous Message | Sami Imseih | 2026-12-04 20:16:30 | Re: Anti-wraparound autovacuum stops for good after no slot available for new autovacuum worker process |