[COMMITTERS] pgsql: Code review for NextValueExpr expression node type.

Поиск
Список
Период
Сортировка
От Tom Lane
Тема [COMMITTERS] pgsql: Code review for NextValueExpr expression node type.
Дата
Msg-id E1dW6Ds-0006sQ-2o@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Code review for NextValueExpr expression node type.

Add missing infrastructure for this node type, notably in ruleutils.c where
its lack could demonstrably cause EXPLAIN to fail.  Add outfuncs/readfuncs
support.  (outfuncs support is useful today for debugging purposes.  The
readfuncs support may never be needed, since at present it would only
matter for parallel query and NextValueExpr should never appear in a
parallelizable query; but it seems like a bad idea to have a primnode type
that isn't fully supported here.)  Teach planner infrastructure that
NextValueExpr is a volatile, parallel-unsafe, non-leaky expression node
with cost cpu_operator_cost.  Given its limited scope of usage, there
*might* be no live bug today from the lack of that knowledge, but it's
certainly going to bite us on the rear someday.  Teach pg_stat_statements
about the new node type, too.

While at it, also teach cost_qual_eval() that MinMaxExpr, SQLValueFunction,
XmlExpr, and CoerceToDomain should be charged as cpu_operator_cost.
Failing to do this for SQLValueFunction was an oversight in my commit
0bb51aa96.  The others are longer-standing oversights, but no time like the
present to fix them.  (In principle, CoerceToDomain could have cost much
higher than this, but it doesn't presently seem worth trying to examine the
domain's constraints here.)

Modify execExprInterp.c to execute NextValueExpr as an out-of-line
function; it seems quite unlikely to me that it's worth insisting that
it be inlined in all expression eval methods.  Besides, providing the
out-of-line function doesn't stop anyone from inlining if they want to.

Adjust some places where NextValueExpr support had been inserted with the
aid of a dartboard rather than keeping it in the same order as elsewhere.

Discussion: https://postgr.es/m/23862.1499981661@sss.pgh.pa.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/decb08ebdf07f2fea4b6bb43380366ef5defbafb

Modified Files
--------------
contrib/pg_stat_statements/pg_stat_statements.c |  8 +++++
src/backend/catalog/dependency.c                | 14 ++++----
src/backend/executor/execExprInterp.c           | 46 +++++++++++++++++--------
src/backend/nodes/nodeFuncs.c                   | 16 ++++-----
src/backend/nodes/outfuncs.c                    | 12 +++++++
src/backend/nodes/readfuncs.c                   | 16 +++++++++
src/backend/optimizer/path/costsize.c           |  9 +++++
src/backend/optimizer/util/clauses.c            | 23 ++++++++++++-
src/backend/utils/adt/ruleutils.c               | 17 +++++++++
src/include/executor/execExpr.h                 |  3 +-
src/include/nodes/nodes.h                       |  2 +-
src/include/nodes/primnodes.h                   | 28 +++++++--------
12 files changed, 147 insertions(+), 47 deletions(-)


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: [COMMITTERS] pgsql: Fix broken link-command-line ordering for libpgfeutils.
Следующее
От: Alvaro Herrera
Дата:
Сообщение: [COMMITTERS] pgsql: pg_upgrade i18n: Fix "%s server/cluster" wording