From c6679e4fca21d253ced84c51ac1a31c1b2aec72f Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Mon, 17 Feb 2020 15:19:58 +0100 Subject: Optimize update of tables with generated columns When updating a table row with generated columns, only recompute those generated columns whose base columns have changed in this update and keep the rest unchanged. This can result in a significant performance benefit. The required information was already kept in RangeTblEntry.extraUpdatedCols; we just have to make use of it. Reviewed-by: Pavel Stehule Discussion: https://www.postgresql.org/message-id/flat/b05e781a-fa16-6b52-6738-761181204567@2ndquadrant.com --- src/include/executor/nodeModifyTable.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/include/executor/nodeModifyTable.h') diff --git a/src/include/executor/nodeModifyTable.h b/src/include/executor/nodeModifyTable.h index 0495cae051c..4ec4ebdabc1 100644 --- a/src/include/executor/nodeModifyTable.h +++ b/src/include/executor/nodeModifyTable.h @@ -15,7 +15,7 @@ #include "nodes/execnodes.h" -extern void ExecComputeStoredGenerated(EState *estate, TupleTableSlot *slot); +extern void ExecComputeStoredGenerated(EState *estate, TupleTableSlot *slot, CmdType cmdtype); extern ModifyTableState *ExecInitModifyTable(ModifyTable *node, EState *estate, int eflags); extern void ExecEndModifyTable(ModifyTableState *node); -- cgit v1.2.3