[COMMITTERS] pgsql: Simplify plpgsql's check for simple expressions.

Поиск
Список
Период
Сортировка
От Tom Lane
Тема [COMMITTERS] pgsql: Simplify plpgsql's check for simple expressions.
Дата
Msg-id E1dhehy-00034e-8N@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Simplify plpgsql's check for simple expressions.

plpgsql wants to recognize expressions that it can execute directly
via ExecEvalExpr() instead of going through the full SPI machinery.
Originally the test for this consisted of recursively groveling through
the post-planning expression tree to see if it contained only nodes that
plpgsql recognized as safe.  That was a major maintenance headache, since
it required updating plpgsql every time we added any kind of expression
node.  It was also kind of expensive, so over time we added various
pre-planning checks to try to short-circuit having to do that.
Robert Haas pointed out that as of the SRF-processing changes in v10,
particularly the addition of Query.hasTargetSRFs, there really isn't
any reason to make the recursive scan at all: the initial checks cover
everything we really care about.  We do have to make sure that those
checks agree with what inline_function() considers, so that inlining
of a function that formerly wasn't inlined can't cause an expression
considered simple to become non-simple.

Hence, delete the recursive function exec_simple_check_node(), and tweak
those other tests to more exactly agree with inline_function().  Adjust
some comments and function naming to match.

Discussion: https://postgr.es/m/CA+TgmoZGZpwdEV2FQWaVxA_qZXsQE1DAS5Fu8fwxXDNvfndiUQ@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/00418c61244138bd8ac2de58076a1d0dd4f539f3

Modified Files
--------------
src/backend/optimizer/util/clauses.c |   5 +
src/pl/plpgsql/src/pl_exec.c         | 387 +++++------------------------------
2 files changed, 53 insertions(+), 339 deletions(-)


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

Предыдущее
От: Michael Meskes
Дата:
Сообщение: [COMMITTERS] pgsql: Allow continuation lines in ecpg cppline parsing.
Следующее
От: Robert Haas
Дата:
Сообщение: [COMMITTERS] pgsql: Assorted preparatory refactoring for partition-wise join.