Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZB5pS-0008DI-JU for pgsql-bugs@arkaria.postgresql.org; Fri, 03 Jul 2015 18:36:50 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZB5pR-0007Ri-D4 for pgsql-bugs@arkaria.postgresql.org; Fri, 03 Jul 2015 18:36:49 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZAwsE-00030H-Fh for pgsql-bugs@postgresql.org; Fri, 03 Jul 2015 09:03:06 +0000 Received: from wrigleys.postgresql.org ([204.145.124.246]) by magus.postgresql.org with esmtp (Exim 4.84) (envelope-from ) id 1ZAwsB-0006Bp-Ek for pgsql-bugs@postgresql.org; Fri, 03 Jul 2015 09:03:05 +0000 MIME-Version: 1.0 Subject: BUG #13484: Performance problem with logical decoding To: pgsql-bugs@postgresql.org From: olivier.gosseaume@free.fr Date: Fri, 03 Jul 2015 09:02:17 +0000 Message-ID: <20150703090217.1190.63940@wrigleys.postgresql.org> X-Pg-Spam-Score: -1.9 (-) Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org 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