Re: Use merge-based matching for MCVs in eqjoinsel

Поиск
Список
Период
Сортировка
От Ilia Evdokimov
Тема Re: Use merge-based matching for MCVs in eqjoinsel
Дата
Msg-id bc35bcb5-238f-4cfc-837a-8b5722ff5c3b@tantorlabs.com
обсуждение исходный текст
Ответ на Re: Use merge-based matching for MCVs in eqjoinsel  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On 03.09.2025 23:26, Tom Lane wrote:
> Ilia Evdokimov <ilya.evdokimov@tantorlabs.com> writes:
>> I’ve attached v3 of the patch. This version adds a check for NULL values
>> when comparing MCV entries, ensuring correctness in edge cases.
> Um ... what edge cases would those be?  We do not put NULL into
> MCV arrays.


You're right - MCV arrays never contain NULLs. However, comparing two
MCV values could theoretically return NULL, even though this is very
unlikely. This check existed even before my changes, and similar checks
are used in other selectivity-estimation functions in 'selfuncs.c'.

...
fcinfo->isnull = false;
fresult = FunctionCallInvoke(fcinfo);
if (!fcinfo->isnull && DatumGetBool(fresult))
...

By "edge cases" I was referring to this situation; I probably did not
choose the best wording.

--
Best regards,
Ilia Evdokimov,
Tantor Labs LLC,
https://tantorlabs.com




В списке pgsql-hackers по дате отправления: