Optimize update of tables with generated columns
Peter Eisentraut <peter@eisentraut.org>
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
| Path | Change | +/− |
|---|---|---|
| src/backend/commands/copy.c | modified | +1 −1 |
| src/backend/executor/execReplication.c | modified | +2 −2 |
| src/backend/executor/nodeModifyTable.c | modified | +31 −6 |
| src/include/executor/nodeModifyTable.h | modified | +1 −1 |
| src/include/nodes/execnodes.h | modified | +3 −0 |
Discussion
- Optimize update of tables with generated columns 4 messages · 2019-12-21 → 2020-02-17