Re: Optimize update of tables with generated columns

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Optimize update of tables with generated columns
Date: 2020-02-13 15:16:46
Message-ID: CAFj8pRA417+4wrHMSXLY_D==Ca7fRd0kNHOT6DaLc906AyKiJg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

čt 13. 2. 2020 v 14:40 odesílatel Peter Eisentraut <
peter(dot)eisentraut(at)2ndquadrant(dot)com> napsal:

> On 2019-12-21 07:47, Peter Eisentraut wrote:
> > When updating a table row with generated columns, we only need to
> > 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 (easy to reproduce for example with a
> > tsvector column). The required information was already kept in
> > RangeTblEntry.extraUpdatedCols; we just have to make use of it.
> >
> > A small problem is that right now ExecSimpleRelationUpdate() does not
> > populate extraUpdatedCols. That needs fixing first.
>
> Here is an updated patch set that contains a fix for the issue above
> (should be backpatched IMO) and the actual performance patch as before.
>

+ 1

I tested check-world without problems, and changes of patch has sense for
me.

Regards

Pavel

> --
> Peter Eisentraut http://www.2ndQuadrant.com/
> PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2020-02-13 15:19:50 Re: Fix compiler warnings on 64-bit Windows
Previous Message David Fetter 2020-02-13 15:11:23 Re: Small docs bugfix: make it clear what can be used in UPDATE FROM and DELETE USING