pgsql: Optimize BooleanTest with non-nullable input - Mailing list pgsql-committers

From Richard Guo
Subject pgsql: Optimize BooleanTest with non-nullable input
Date
Msg-id E1vpcQc-002BJt-1V@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Optimize BooleanTest with non-nullable input

The BooleanTest construct (IS [NOT] TRUE/FALSE/UNKNOWN) treats a NULL
input as the logical value "unknown".  However, when the input is
proven to be non-nullable, this special handling becomes redundant.
In such cases, the construct can be simplified directly to a boolean
expression or a constant.

Author: Richard Guo <guofenglinux@gmail.com>
Reviewed-by: Tender Wang <tndrwang@gmail.com>
Discussion: https://postgr.es/m/CAMbWs49BMAOWvkdSHxpUDnniqJcEcGq3_8dd_5wTR4xrQY8urA@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/0aaf0de7fed8555114aca766e9cdc836dad763a3

Modified Files
--------------
src/backend/optimizer/util/clauses.c    |  31 +++++++++
src/test/regress/expected/predicate.out | 119 ++++++++++++++++++++++++++++++++
src/test/regress/sql/predicate.sql      |  54 +++++++++++++++
3 files changed, 204 insertions(+)


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: pgsql: Stamp 14.21.
Next
From: Michael Paquier
Date:
Subject: pgsql: Add information about range type stats to pg_stats_ext_exprs