Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1j2J2O-0001Uc-Ri for pgsql-general@arkaria.postgresql.org; Thu, 13 Feb 2020 18:16:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1j2J2N-000432-7u for pgsql-general@arkaria.postgresql.org; Thu, 13 Feb 2020 18:16:31 +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_SHA1:256) (Exim 4.89) (envelope-from ) id 1j2J2L-00042v-A8 for pgsql-general@lists.postgresql.org; Thu, 13 Feb 2020 18:16:30 +0000 Received: from [64.147.123.20] (helo=wout4-smtp.messagingengine.com) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1j2J2G-00082A-BC for pgsql-general@lists.postgresql.org; Thu, 13 Feb 2020 18:16:28 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id C9918FDE; Thu, 13 Feb 2020 13:16:11 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Thu, 13 Feb 2020 13:16:11 -0500 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=fm2; bh=i wl5P9NceZenx3Tp6pRlHVGX4BnH77hpga1oJXH0kqM=; b=fqThulaxfdAUSc+wb YWSx3bPcqb3Fp9JthKfcjLMwyLDSJEqDo6ME8+K3/TIn58wHx+ONZZmM1CRdk0pD H00UjXg+JzYbeqBJ8lBA6oIvRxcfygdQ2Xtz/SrcE3BY6pVqkV4PX9IGMAO2dHbO l7md/9LsTQKBw7E1rZmHQaJIGlL9lBL3uQhY7PbaQKCSCNFWGxsfnqi70qcPaGyn sRlUVZraGTIH1B+No1k2hEG5MfxCkuct6/DbPrECFE5t0vrweY5bngpt44phO8dp TFa79E63PPUropsPWK2vOTZyyFbwolZAMjGT8C+m0EX0hs4uQ0Y/QLZuhGPndV8s l2TYg== 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=fm2; bh=iwl5P9NceZenx3Tp6pRlHVGX4BnH77hpga1oJXH0k qM=; b=VossEl2tgOCqt3ylEvQqOpXQSeWNPedcLhG2bvGVOpVA0pmp0TdrKYQwA zr2TzYChsjpl9xEI07N/wsnZUmYHC/+9V+li7xaOzqEc71GDWCPeo7KS6Ml/CqOt MsAi0pbtA7jc7XG0fe/CbvembDtCu492LDXI/kMWy1Qct2WmU35DvjA+gqPZ08d6 LKLFoM2XP/uNRMkmyhXRnO5Nm+FDMdFvFC1nxQJN+fZNmBqU96EZnNa9p6gGTXc6 0ErFpvNsUaJUKp87h/r7IcwIxhLtjBN8dZ3ymjM/30VXyFqErTLKTSTlGDYuXQ3C VGemzS2+D3stbvg9RoVDTUekT8gjw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrieekgdduuddvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepuffvfhfhkffffgggjggtgfesthekredttdefheenucfhrhhomheptegurhhi rghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtoh hmqeenucffohhmrghinhepphhoshhtghhrvghsqhhlrdhorhhgnecukfhppeeljedruddu fedrudektddrvddtleenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrih hlfhhrohhmpegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtohhm X-ME-Proxy: Received: from ranger.suse (97-113-180-209.tukw.qwest.net [97.113.180.209]) by mail.messagingengine.com (Postfix) with ESMTPA id D5FB93280065; Thu, 13 Feb 2020 13:16:10 -0500 (EST) Subject: =?UTF-8?Q?Re=3a_pg=5fupgrade_=e2=80=94link_does_it_remove_table_blo?= =?UTF-8?Q?at?= To: Jason Ralph , "pgsql-general@lists.postgresql.org" References: From: Adrian Klaver Message-ID: Date: Thu, 13 Feb 2020 10:16:09 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Host-Lookup-Failed: Reverse DNS lookup failed for 64.147.123.20 (deferred) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2/13/20 10:04 AM, Jason Ralph wrote: >> Well table bloat and table statistics are two different things. Bloat is the accumulation of dead or potentially dead tuples whose space has not been marked > as available for reuse by VACUUM or whose space has been returned to the OS with VACUUM FULL. For more information see: > > Thanks for the helpful response @Adrian Klaver, > Let me try to rephrase my question, > If a table has bloat before the upgrade, autvacuum was not aggressive enough, once pg_upgrade is complete, the same table will contain the same amount of bloat(dead tuples)? Meaning its not the same as pg_dump / pg_restore since it’s a hard link to the previous data location. Pg_upgrade with link will not recreate the table. Yes pg_upgrade is a transfer of the binary data(sort of) whereas pg_dump/restore is a logical transfer. So pg_upgrade via copy/clone/link will not recreate user tables. For a good overview see IMPLEMENTATION file in src: https://git.postgresql.org/gitweb/?p=postgresql.git;a=blob;f=src/bin/pg_upgrade/IMPLEMENTATION;h=69fcd70a7c526d9f27b43a49f71e9b591a6b889f;hb=HEAD7 > > Jason Ralph -- Adrian Klaver adrian.klaver@aklaver.com