Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jhIVb-0001qt-9i for pgsql-general@arkaria.postgresql.org; Fri, 05 Jun 2020 20:00:07 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jhIVa-0002Hp-5r for pgsql-general@arkaria.postgresql.org; Fri, 05 Jun 2020 20:00:06 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jhIVY-0002Ea-Ia for pgsql-general@lists.postgresql.org; Fri, 05 Jun 2020 20:00:05 +0000 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jhIVR-0007pl-Fj for pgsql-general@postgresql.org; Fri, 05 Jun 2020 20:00:03 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 72546A92; Fri, 5 Jun 2020 15:59:54 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 05 Jun 2020 15:59:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm3; bh=K XWrw3B3IohQs43oBhmI/ZQPKmTjjkpsZK++PmkLvDo=; b=xWQ3ZT2Sn1imza4+w RAKI9R1Z3fuY+enSJIQL+P3vxZSTz/uOvh6nkdd/o1E3UUQ9Cl2lsg/OynZabJMb AjsRpMdn6nvJlI75TwBc3+y30laWITybBfFct0HrvGpLZ5kj5JkAOtwNRWLnYRHR p+cQE9NF0o0ErDnwh4h6+fjT6yLCjOfi5MNpfPsqs6kMkn6RDta/gEaAKDLm8jvH DYMJ41LV0QK0fiPSEJ80sPGeeSyVECXjVA2nXhtCw1HqOXQ9dTDRpv6cFCFTnkuy 8DIr95Z5mQWy1E1AGuxhwQJQHyzRGxa60weWpQKQyLyYgcyx9zVPhr1UEDplZXUa AmfQA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=KXWrw3B3IohQs43oBhmI/ZQPKmTjjkpsZK++PmkLv Do=; b=RNNypjv15zjualIiB81/zsouEjl5xPabw8yK0RxBezItIpIl7XUIeBtrU ADJ6oR8ih1cTSFabs9qAo7LZY/umLTxI8iUOpJGQE98k9pl90N2MXT/an9Mretnk LrRVI3td6yiBJa9A1m96eax9zqJchEIWQ1rCVssifB7Xl6cafSltSObShG6HairI Y7P+hFw+2944fJ5o4hUg7ynX1l9H28AaoDj9BWaNAxuKSaCnbTx5FmpX3MSC/WZF v8MIXMpW57jkl8Q5Um+dcUImU0KMKGBzrh9a3catyMFG8DWWy9OgKObDFKRcow8J 3K6iPu2okVI6hdW/WIGZdBr0xSG5w== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrudegfedgudeftdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefuvfhfhffkffgfgggjtgfgsehtkeertddtfeejnecuhfhrohhmpeetughr ihgrnhcumfhlrghvvghruceorggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtg homheqnecuggftrfgrthhtvghrnheptdegffdvfeduhfdvteegieetieehieelueeiheet vdehteffgeeufeeitedvgffhnecuffhomhgrihhnpegrmhgriihonhdrtghomhenucfkph epjeehrddujedvrdehrddvfedunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghm pehmrghilhhfrhhomheprggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomh X-ME-Proxy: Received: from [192.168.1.3] (75-172-5-231.tukw.qwest.net [75.172.5.231]) by mail.messagingengine.com (Postfix) with ESMTPA id 85926328005D; Fri, 5 Jun 2020 15:59:53 -0400 (EDT) Subject: Re: Logical Replication and table bloat To: =?UTF-8?B?TWFydMOtbiBGZXJuw6FuZGV6?= , pgsql-general@postgresql.org References: <960E21B1-2AE7-49EE-B9F5-6FD9AD00C366@gmail.com> From: Adrian Klaver Message-ID: <9ff805fa-85b0-28b9-44e6-1130a2f14f9d@aklaver.com> Date: Fri, 5 Jun 2020 12:59:52 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.1 MIME-Version: 1.0 In-Reply-To: <960E21B1-2AE7-49EE-B9F5-6FD9AD00C366@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 6/5/20 12:53 PM, Martín Fernández wrote: > Hello, > > Yesterday we stumbled upon a performance issue that we were not expecting. We are replicating our database using AWS DMS which uses logical replication to capture changes. We have some hot tables that get updated very regularly and with the DMS turned on we started noticing that in those table, table bloat increased considerably ~15 times more free_tuples than the average. > > When doing logical replication, the subscriber will hold the tuples that could be flagged for reuse until they are sent ? Just trying to understand a little bit better how the logical replication is affecting the vacuuming. A question for the AWS folks: https://forums.aws.amazon.com/forum.jspa?forumID=60 > > Thanks before hand! > > Best, > Martín > -- Adrian Klaver adrian.klaver@aklaver.com