From: | Amit Langote <amitlan(at)postgresql(dot)org> |
---|---|
To: | pgsql-committers(at)lists(dot)postgresql(dot)org |
Subject: | pgsql: SQL/JSON: Avoid initializing unnecessary ON ERROR / ON EMPTY ste |
Date: | 2024-09-09 06:59:44 |
Message-ID: | E1snYNE-000GR9-LU@gemulon.postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-committers |
SQL/JSON: Avoid initializing unnecessary ON ERROR / ON EMPTY steps
When the ON ERROR / ON EMPTY behavior is to return NULL, returning
NULL directly from ExecEvalJsonExprPath() suffices. Therefore, there's
no need to create separate steps to check the error/empty flag or
those to evaluate the the constant NULL expression. This speeds up
common cases because the default ON ERROR / ON EMPTY behavior for
JSON_QUERY() and JSON_VALUE() is to return NULL. However, these steps
are necessary if the RETURNING type is a domain, as constraints on the
domain may need to be checked.
Reported-by: Jian He <jian(dot)universality(at)gmail(dot)com>
Author: Jian He <jian(dot)universality(at)gmail(dot)com>
Author: Amit Langote <amitlangote09(at)gmail(dot)com>
Discussion: https://postgr.es/m/CACJufxEo4sUjKCYtda0_qt9tazqqKPmF1cqhW9KBOUeJFqQd2g@mail.gmail.com
Backpatch-through: 17
Branch
------
REL_17_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/77aebe9a8d3cccd4c54b43be87a38f2bae614c76
Modified Files
--------------
src/backend/executor/execExpr.c | 32 ++++++++++++++++++++++++++------
src/backend/executor/execExprInterp.c | 14 ++++++++------
2 files changed, 34 insertions(+), 12 deletions(-)
From | Date | Subject | |
---|---|---|---|
Next Message | Robert Haas | 2024-09-09 15:56:44 | pgsql: Add PQfullProtocolVersion() to surface the precise protocol vers |
Previous Message | Michael Paquier | 2024-09-09 04:50:51 | pgsql: Fix waits of REINDEX CONCURRENTLY for indexes with predicates or |