Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1evWM7-00083m-B8 for pgsql-general@arkaria.postgresql.org; Mon, 12 Mar 2018 22:55:47 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1evWM6-0007GE-2l for pgsql-general@arkaria.postgresql.org; Mon, 12 Mar 2018 22:55:46 +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.89) (envelope-from ) id 1evWM5-0007G5-LN for pgsql-general@lists.postgresql.org; Mon, 12 Mar 2018 22:55:45 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1evWM2-0002iS-A3 for pgsql-general@lists.postgresql.org; Mon, 12 Mar 2018 22:55:45 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id B5C1E20B8C; Mon, 12 Mar 2018 18:55:40 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute6.internal (MEProxy); Mon, 12 Mar 2018 18:55:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; bh=GVqnPjeo+RqJ23+PY27r5Klev3vmS MXLS31Ps+NqumI=; b=H/tr6r9wjxn5BzohwkAX/Alu5+xfBI244boTKaAHN9vAK J3wjEXf5i76CBdCKeg138oZohit3knYmS70kP94qo6GOBMTn78vwm4qwQu7qamK+ z41NWJYv1lTV6jMqYCHgW+Abl0ILqs8G8UVw4AyktFLefZP6Y3dwslZt2oMOracE /FP9UH35MNpPvZyMbzhAB5wAYn6NVSsoqrnnhFRqaHbvBRfH62wWpdIl6gMecmku DfnUFeGeMQYBcl2rMH0pqWgezGlz6A0L2f81rKnBf7/ORyA0hof7z3XR2lS5f4HD KU3JbMY8aEhtkFMosKpG6Aqf4ExeJySM5dN6mEhFA== 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-sender:x-me-sender:x-sasl-enc; s=fm2; bh=GVqnPj eo+RqJ23+PY27r5Klev3vmSMXLS31Ps+NqumI=; b=AC1Xwb2/CN8+iRiMcpGWcW jycDSLA/ZSDEoaAMgjCHv+UNlUprNaYpLdVDsyBm/lozMbNFG1hz39gyHk4Qx4su teD4uR4OF3utPTmbiMy/msc3WB5cS2UJmz5OM+WEbgPtUp8GUhKJ89KGIvHLsWpv qoh4EbIIYMGC6uJivyQldjoZs/YENIVe42+UoZTRtpMm+WwZsYO+PZBEEn2S64j6 CooeCcWzwri1AzNIvyzlS70cD/lV5WwKNqLLJSKCcpfbEUXP7er3KCZ/mhH6Teo0 SpyC28+G/8JtAUQwztmLKP0I5zcJJBTetcPOKfG6Oys7zPfWnSdaT0OxrYd/iz3g == X-ME-Sender: Received: from [192.168.1.2] (71-35-123-124.tukw.qwest.net [71.35.123.124]) by mail.messagingengine.com (Postfix) with ESMTPA id 326C8240DD; Mon, 12 Mar 2018 18:55:40 -0400 (EDT) Subject: Re: Reindex doesn't eliminate bloat To: Ron Johnson , pgsql-general@lists.postgresql.org References: <8ba3c6c1-709b-d853-97f0-9ef458528b3d@cox.net> From: Adrian Klaver Message-ID: Date: Mon, 12 Mar 2018 15:55:39 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <8ba3c6c1-709b-d853-97f0-9ef458528b3d@cox.net> 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 03/12/2018 03:05 PM, Ron Johnson wrote: > v8.4.12 > > According to this (https://pastebin.com/TJB32n5M) query, which I thought > I got from https://wiki.postgresql.org/wiki/Index_Maintenance, a list of > indexes and their bloat is generated. > > After reindexing a table with a large amount of reported bloat (column > bloat_pct says 29%), re-running the query shows no change in the amount First I am not seeing a column bloat_pct in the query you linked to, so are you sure that is the actual query you used? > of bloat.  This is a historical table, and VACUUM VERBOSE shows that > there's nothing to free up. > > Is this something that I must live with, or am I misinterpreting the query? Honestly I have not worked my way in depth through the query you show, though I did notice it uses pg_stats. What happens if run ANALYZE (https://www.postgresql.org/docs/8.4/static/sql-analyze.html) to update the stats? > > Thanks, > -- Adrian Klaver adrian.klaver@aklaver.com