pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: olivier.gosseaume@free.fr
To: pgsql-bugs@postgresql.org
Subject: BUG #13484: Performance problem with logical decoding
Date: Fri, 03 Jul 2015 09:02:17 +0000
Message-ID: <20150703090217.1190.63940@wrigleys.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

The following bug has been logged on the website:

Bug reference:      13484
Logged by:          Olivier Gosseaume
Email address:      olivier.gosseaume@free.fr
PostgreSQL version: 9.4.4
Operating system:   Windows 7 64 bits (dev system)
Description:        

Problem: when a transaction involve more than 4095 operations, logical
decoding on the receiver end become very very slow.

Repro :
Open two psql sessions 1 and 2 

On session 1 :
Prepare :
CREATE TABLE data(id serial primary key, data text);

On session 2 (receiver) :
Prepare :
\timing on
SELECT pg_create_logical_replication_slot('my_slot','test_decoding');

Run :
On session 1 : insert into data (data) values (generate_series(1,4095));
On session 2 : select pg_logical_slot_get_changes('my_slot', NULL, NULL);
--> returns in 80mS (plenty fast)

On session 1 : insert into data (data) values (generate_series(1,4095)); -->
repeat this 10 times to insert 40950 rows
On session 2 : select pg_logical_slot_get_changes('my_slot', NULL, NULL);
--> returns in 380mS (plenty fast)

Now the problem :
On session 1 : insert into data (data) values (generate_series(1,4096));
On session 2 : select pg_logical_slot_get_changes('my_slot', NULL, NULL);
--> returns in 4204mS (ie 52x times slower than "normal")

On session 1 : insert into data (data) values (generate_series(1,40950));
On session 2 : select pg_logical_slot_get_changes('my_slot', NULL, NULL);
--> returns in 34998mS (ie 92x times slower than "normal")









-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (19+ messages)  latest in thread

Message-ID: <20150703090217.1190.63940@wrigleys.postgresql.org>
Permalink:  ../20150703090217.1190.63940@wrigleys.postgresql.org/
Also on:    postgresql.org/message-id/20150703090217.1190.63940@wrigleys.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-bugs@postgresql.org
  Cc: olivier.gosseaume@free.fr
  Subject: Re: BUG #13484: Performance problem with logical decoding
  In-Reply-To: <20150703090217.1190.63940@wrigleys.postgresql.org>
  References: <20150703090217.1190.63940@wrigleys.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