Re: constraint exclusion and nulls in IN (..) clause

From: Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, emre(at)hasegeli(dot)com
Cc: Ashutosh Bapat <ashutosh(dot)bapat(at)enterprisedb(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: constraint exclusion and nulls in IN (..) clause
Date: 2018-03-22 10:22:56
Message-ID: b0501496-5290-9fea-e704-6c5e9abbef31@lab.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2018/03/21 23:00, Tom Lane wrote:
> Emre Hasegeli <emre(at)hasegeli(dot)com> writes:
>> I am not sure if we are covering the case when clause_const and
>> pred_const are both NULL. In this case, we should be able to return
>> true only by checking op_strict(pred_op) or maybe even without
>> checking that. Am I mistaken?
>
> Yeah, that's there. We need both operators to be strict, I think;
> otherwise we can't really assume anything about what they'd return
> for NULL inputs. But if they are, we have NULL => NULL which is
> valid for all proof cases.

Thank you for closing the CF entry.

I too wasn't sure if the patch's modifications to
operator_predicate_proof() led to correct handling for the case where both
clause_const and pred_const are both NULL consts. ISTM that the result in
that case becomes what operator_same_subexprs_proof() would return for the
pred_op (possibly commuted) and clause_op pair. But maybe we don't end up
in that case much.

Regards,
Amit

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeevan Chalke 2018-03-22 10:27:31 Re: [HACKERS] Partition-wise aggregation/grouping
Previous Message Jeevan Chalke 2018-03-22 10:15:56 Re: [HACKERS] Partition-wise aggregation/grouping