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 1jhxrF-0000Xp-Ca for pgsql-general@arkaria.postgresql.org; Sun, 07 Jun 2020 16:09:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jhxqh-000485-0f for pgsql-general@arkaria.postgresql.org; Sun, 07 Jun 2020 16:08:39 +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 1jhxqf-000472-17 for pgsql-general@lists.postgresql.org; Sun, 07 Jun 2020 16:08:38 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jhxqX-00052G-7g for pgsql-general@lists.postgresql.org; Sun, 07 Jun 2020 16:08:35 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id B3FC05C007D; Sun, 7 Jun 2020 12:08:27 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Sun, 07 Jun 2020 12:08:27 -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=v nHIy+B2JssyVlO8eLwg43pnXEqTwZQj9sp6YA/r/DQ=; b=oPdDY1sCxB9ReKBpB JE6Pzy2qwxzZlqIefeGb2LydMQONyEl8+jK8igdKCHjC49KeadoePLLzQ/hUiJ+/ 8ROIV4hGyL0D6ARbRsEtbJdw/o59jQiuMPapqTFwBxQAMIo+4BrgypDvDthO7V5/ t5FrT/sr1lGhpKEB5Y8Yeg0z5pM643mbPmpvR6pKzXh/ZYyl/rhy7ojrLnQh+2Qm hFhmBswvCfqfAeO+tarHuSjj0Y7VIquNxrASNHo1shnZ2dhkNZ97s+fi3/7WNMc/ kXQbkVUbrPztzcVuGg2dgf6IG8kVJwL5TK+9lmhhs7sselB/XUeaZsHZvl0V/8ks uVEoQ== 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=vnHIy+B2JssyVlO8eLwg43pnXEqTwZQj9sp6YA/r/ DQ=; b=HcJmvR17ouURAPQkkKLBHmVEjlmsOVrQa8h2qEEZywdkyc8GvBIKFXd0c tlwGgon8yTqytKaTfNMhAHB00cUxJa+YSw2IMd1InWU6UhhfgwDbTpTlbRVcZEpf BGr3YvBEAEIU6rCcgnXWxBTgSB8Rq7mPr6X2ZYbFwS2Zh4EvxP2tGYR79lXtHjEO pOryj1XG4woEwFkB/ZaTeUjZGkL40v+t8k/3DqiajnzrBEZWAIgw6Op1lOBiVwQ9 F4z1LKHb3sYknoiJbHsbfe2GyB7RqZKmltM5R0/GHBA9gTe7QtJw0JiLrVybyygT ozU4Ij0ZcGI2FB9ze5owmanKEbwAw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrudegledgleelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepuffvfhfhkffffgggjggtgfesthekredttdefjeenucfhrhhomheptegurhhi rghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtoh hmqeenucggtffrrghtthgvrhhnpeffgfeggefgveeugefgheejvddvkeetvefffeetleef geefvdfhieejgefgtdelfeenucffohhmrghinhepphhoshhtghhrvghsqhhlrdhorhhgpd gsuhgtrghrughordhorhhgpdhophgvnhhfihhnrdgtohenucfkphepjeehrddujedvrdeh rddvfedunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomh eprggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomh 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 C094B3060FE7; Sun, 7 Jun 2020 12:08:26 -0400 (EDT) Subject: Re: Question on full vacuum clearing waste space To: Wenjun Che , pgsql-general@lists.postgresql.org References: From: Adrian Klaver Message-ID: Date: Sun, 7 Jun 2020 09:08:25 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: 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/7/20 6:06 AM, Wenjun Che wrote: > Thank you for the quick response. > > I ran the script from > https://wiki.postgresql.org/wiki/Show_database_bloat, which shows > "app_event_users" table has 3751936 as wastedbytes. https://bucardo.org/check_postgres/check_postgres.pl.html#bloat "Please note that the values computed by this action are not precise, and should be used as a guideline only. Great effort was made to estimate the correct size of a table, but in the end it is only an estimate. The correct index size is even more of a guess than the correct table size, but both should give a rough idea of how bloated things are." > > On Sun, Jun 7, 2020 at 12:32 AM Mohamed Wael Khobalatte > > wrote: > > > On Sat, Jun 6, 2020 at 11:24 PM Wenjun Che > wrote: > > Hi > > I am testing full vacuum with pg 10.10 on AWS RDS.  I noticed > for some tables, the number of waste bytes stays at a few MB > after I run full vacuum.  I double-checked that there are no > long running transactions, no orphaned prepared transactions and > no abandoned replication slots. > > Here is output from full vacuum for one of the tables: > > VACUUM(FULL, ANALYZE, VERBOSE) app_events_users > vacuuming "app_events_users" > "app_events_users": found 0 removable, 1198881 nonremovable row > versions in 13369 pages > analyzing "licensing.app_events_users" > "app_events_users": scanned 13369 of 13369 pages, containing > 1198881 live rows and 0 dead rows; 30000 rows in sample, 1198881 > estimated total rows > > What else can prevent full vacuum from reclaiming all waste space ? > > Thank you > > > What "waste query" are you running? Those tend to be estimates only. > Vacuum Full clearly did its job from that log you shared. > > > > -- > Wenjun Che > VP of Engineering | OpenFin > wenjun@openfin.co > > *Move Fast.  Break Nothing.* > www.openfin.co | @openfintech -- Adrian Klaver adrian.klaver@aklaver.com