Optimize update of tables with generated columns

Peter Eisentraut <peter@eisentraut.org>

Commit: c6679e4fca21d253ced84c51ac1a31c1b2aec72f
Author: Peter Eisentraut <peter@eisentraut.org>
Date: 2020-02-17T14:20:58Z
Releases: 13.0
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

Files

Discussion