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 1kFYz1-00083y-8B for pgsql-general@arkaria.postgresql.org; Tue, 08 Sep 2020 08:28: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 1kFYyz-0002wQ-5X for pgsql-general@arkaria.postgresql.org; Tue, 08 Sep 2020 08:28:05 +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 1kFYyy-0002wI-Tu for pgsql-general@lists.postgresql.org; Tue, 08 Sep 2020 08:28:04 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kFYyw-0004o1-QQ for pgsql-general@postgresql.org; Tue, 08 Sep 2020 08:28:03 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id AB5D95C0167; Tue, 8 Sep 2020 04:28:01 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Tue, 08 Sep 2020 04:28:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm2; bh=mN364qhx/HYblMW4/4UyNHj1anZ +kNa2S5E7gmSfOKI=; b=cMi1celKRxIWB5A37xNHK7cbKsZDe2Sa8HopaOc9NYN MbGEPrD8zN9U+GB4dUUQhvkKli/sQh5dmXeX4LItAiryWB4SYADYjOZNJSHsUYds dW6mSCo/AGQinQUuJi7tcMQhHH4VvVhZedM8qywKlcRXIgH2z10k6Ap1CytlhLr7 fhAF8Dm/TFefEp9ntlLxtbdA+E5q8g8UoH9XhCPWTHRoJKeSpdarY36ciKXwILB+ 8ZnL2i0GDDVB9f4m1CjHx1UsPJe5/O5hKeJMHK1Wj0rgXmdc8LqyxY02VBffcZBM imXB34BepiB77N6eQ6XCz4xIRKEr+GFk2R8EHaggy3g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc: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=mN364q hx/HYblMW4/4UyNHj1anZ+kNa2S5E7gmSfOKI=; b=j5J1nitF9zKPl0MnzbnLUl gIKm/gkfRy8lXq3TaTtO0oU/VS4tJ99GON55UXOWBe8w4+Kw3d3Ua9TJlntMbc0c lzTIRb4fyPdbeQjpqArpt0ggK6tovJiLDnWDCaqka5cUhSfhjZPmyUqrKz4VJ6c/ rf8Mn6PufkJEbCA2lM+K6zqDW15gD5WvvQBTR59F+65r4zBi4/yx+cUzQp49y0Vn LZsgWxm6m82VC7heegcaxrhdaoO9mao4nXNFdQAbNvxRh3qO658h1aO2S8l+ADqg 8a0z1Zw2ipBrUFLYzqT9qEW8GUyCOT6FiFMLEhAXDm9rSER6j9wQxWYlbwXr/18A == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduiedrudehvddgtdefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdljedtmdenucfjughrpeffhffvuffkfhggtggujgesghdtreertddt vdenucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrhcuoehmihgthhgrvghlsehprg hquhhivghrrdighiiiqeenucggtffrrghtthgvrhhnpedvgeduuefhtdeuleettdevjeeh heeiveeuieegleetgeeljeelieeuieehgeevhfenucfkphepudduuddruddtvddrudektd drudekheenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhm pehmihgthhgrvghlsehprghquhhivghrrdighiii X-ME-Proxy: Received: from paquier.xyz (ee0822lan1.rev.em-net.ne.jp [111.102.180.185]) by mail.messagingengine.com (Postfix) with ESMTPA id 276853280063; Tue, 8 Sep 2020 04:27:59 -0400 (EDT) Date: Tue, 8 Sep 2020 17:27:55 +0900 From: Michael Paquier To: Michael Holzman Cc: Pavel Stehule , "pgsql-general@postgresql.org >> PG-General Mailing List" Subject: Re: Autovacuum of independent tables Message-ID: <20200908082755.GI19261@paquier.xyz> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="fU0UwhtRbpo05rnG" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --fU0UwhtRbpo05rnG Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Sep 08, 2020 at 11:16:04AM +0300, Michael Holzman wrote: > Autovacuum does not clean dead tuples of closed transactions in tableB > while there is an open transaction on tableA. > But the tables have nothing in common. They are handled by separate > applications and there are no transactions that touch both tables > simultaneously. > Why does autovacuum create an artificial dependency on the tables? This is called MVCC, which applies to a session as a whole. The point here is that even if your application knows that only tableA is used by a given transaction, Postgres cannot know that, as it could be possible that data from tableB is needed in this same transaction, so old versions of the rows from tableB matching with the snapshot hold by this long-running transaction still have to be around. -- Michael --fU0UwhtRbpo05rnG Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAl9XQIsACgkQnvQgOdby QH1z4g/8DbIUaF5qMKJ+5zVETB19dcSowe5BKR+Zu1j37Pw+vyTbaoo4XMymw22a WrI1Q3XSDTYkghdBolo3Y2zsZFPBfy4SIJDPZmFExBduY4COa2SGD913HIbMApRj pH5FLx73MG8jPWbp98LLg2h/yls6SY3Re1MnM9IjGz6Ohl1F3mxKrH5g0YNWhUcO jkVsFMSlIyu5FIM8IilyymN9RU8agt/kMmiVCXTGKvWvCA0jO2tXoMmoviGcYa/+ ZaCfeAjxPrH91dtoTQQM2cxOoq4XdvnKIzq2Crg03EOIhEZORv1934Llx92RRHv6 hGAENuSRg4mARhB8qK5b1Aq3bVMyB7LKp9asSTLC/sSV+ofu7/j5X2N904c4dHt3 KtMS2l3hzHgEnndPFbtSimHVBSemplOmkCOm54ik3FdScLyysFz+029XXLq0aBeG 9tTSe0iCkRUGQsS1eR1apiJpM2njjt5HThlhHLQgg79iOyOmIoC/d9rSsi7faUWR eyGVWxgnR2X5jsUZvE/t8AOkcLxwDR6zI2y1dvRRNSS8Rl1KdMKReJlXk5y+wC5T JIg1CUX+a9AuuwUPyG1oi8xNLJKOH76Mlo9MmHyyDk/GCBzVGkpBUemkroAMryox o+n1hOTICse0d093sWrlpDEXG9oZpsDsIzWdgy6d5DhrnlrjBbA= =/i5w -----END PGP SIGNATURE----- --fU0UwhtRbpo05rnG--