pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Amit Kapila <akapila@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Execute invalidation messages for each XLOG_XACT_INVALIDATIONS m
Date: Thu, 15 Oct 2020 02:57:15 +0000
Message-ID: <E1kStS7-0005eO-Aa@gemulon.postgresql.org> (raw)

Execute invalidation messages for each XLOG_XACT_INVALIDATIONS message
during logical decoding.

Prior to commit c55040ccd0 we have no way of knowing the invalidations
before commit. So, while decoding we use to execute all the invalidations
at each command end as we had no way of knowing which invalidations
happened before that command. Due to this, transactions involving large
amounts of DDLs use to take more time and also lead to high CPU usage. But
now we know specific invalidations at each command end so we execute only
required invalidations.

It has been observed that decoding of a transaction containing truncation
of a table with 1000 partitions would be finished in 1s whereas before
this patch it used to take 4-5 minutes.

Author: Dilip Kumar
Reviewed-by: Amit Kapila and Keisuke Kuroda
Discussion: https://postgr.es/m/CANDwggKYveEtXjXjqHA6RL3AKSHMsQyfRY6bK+NqhAWJyw8psQ@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/d7eb52d7181d83cf2363570f7a205b8eb1008dbc

Modified Files
--------------
src/backend/replication/logical/reorderbuffer.c | 103 +++++++++++++++++++-----
src/include/replication/reorderbuffer.h         |  12 ++-
2 files changed, 92 insertions(+), 23 deletions(-)



Message-ID: <E1kStS7-0005eO-Aa@gemulon.postgresql.org>
Permalink:  ../E1kStS7-0005eO-Aa@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1kStS7-0005eO-Aa@gemulon.postgresql.org

 · 

reply

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: akapila@postgresql.org
  Subject: Re: pgsql: Execute invalidation messages for each XLOG_XACT_INVALIDATIONS m
  In-Reply-To: <E1kStS7-0005eO-Aa@gemulon.postgresql.org>
  References: <E1kStS7-0005eO-Aa@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