mirror of
https://github.com/postgres/postgres.git
synced 2025-08-25 20:23:07 +03:00
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 <pavel.stehule@gmail.com> Discussion: https://www.postgresql.org/message-id/flat/b05e781a-fa16-6b52-6738-761181204567@2ndquadrant.com
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user