diff options
author | Peter Eisentraut <peter@eisentraut.org> | 2020-02-17 15:19:58 +0100 |
---|---|---|
committer | Peter Eisentraut <peter@eisentraut.org> | 2020-02-17 15:20:58 +0100 |
commit | c6679e4fca21d253ced84c51ac1a31c1b2aec72f (patch) | |
tree | af48ab74e7d45752731f72081c303ca98aa969cc /src/include/nodes/execnodes.h | |
parent | ad3ae64770e5b4391ad07fb2a689d72aa45b4689 (diff) | |
download | postgresql-c6679e4fca21d253ced84c51ac1a31c1b2aec72f.tar.gz postgresql-c6679e4fca21d253ced84c51ac1a31c1b2aec72f.zip |
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
Diffstat (limited to 'src/include/nodes/execnodes.h')
-rw-r--r-- | src/include/nodes/execnodes.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/include/nodes/execnodes.h b/src/include/nodes/execnodes.h index 5d5b38b8799..cd3ddf781f1 100644 --- a/src/include/nodes/execnodes.h +++ b/src/include/nodes/execnodes.h @@ -457,6 +457,9 @@ typedef struct ResultRelInfo /* array of stored generated columns expr states */ ExprState **ri_GeneratedExprs; + /* number of stored generated columns we need to compute */ + int ri_NumGeneratedNeeded; + /* for removing junk attributes from tuples */ JunkFilter *ri_junkFilter; |