From: Peter Eisentraut <peter@eisentraut.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Optimize update of tables with generated columns
Date: Mon, 17 Feb 2020 15:14:11 +0000
Message-ID: <E1j3i67-0002Nb-07@gemulon.postgresql.org> (raw)
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
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/c6679e4fca21d253ced84c51ac1a31c1b2aec72f
Modified Files
--------------
src/backend/commands/copy.c | 2 +-
src/backend/executor/execReplication.c | 4 ++--
src/backend/executor/nodeModifyTable.c | 37 ++++++++++++++++++++++++++++------
src/include/executor/nodeModifyTable.h | 2 +-
src/include/nodes/execnodes.h | 3 +++
5 files changed, 38 insertions(+), 10 deletions(-)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: peter@eisentraut.org
Subject: Re: pgsql: Optimize update of tables with generated columns
In-Reply-To: <E1j3i67-0002Nb-07@gemulon.postgresql.org>
References: <E1j3i67-0002Nb-07@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox