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 1ez6ce-0001KC-Fm for pgsql-hackers@arkaria.postgresql.org; Thu, 22 Mar 2018 20:15:40 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ez6cc-0001sD-Mr for pgsql-hackers@arkaria.postgresql.org; Thu, 22 Mar 2018 20:15:38 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1ez6cc-0001rg-6C for pgsql-hackers@lists.postgresql.org; Thu, 22 Mar 2018 20:15:38 +0000 Received: from mail-wr0-x244.google.com ([2a00:1450:400c:c0c::244]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ez6cY-0005kO-Bz for pgsql-hackers@postgresql.org; Thu, 22 Mar 2018 20:15:36 +0000 Received: by mail-wr0-x244.google.com with SMTP id p53so2462005wrc.10 for ; Thu, 22 Mar 2018 13:15:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=7IDqL5TRSCZjRLpIL6vZ5DnuPgG95ymiO2xe/C2km9Y=; b=v3T63OM8RMOR6PN6lER1AsLY62+ItJM0n3ZZiNloCuUy05TqmddtzqD3+4AXXsAJN+ JseaQiM5r3AvCU0BosVGfDg2/APtvrBr/muhJh1K8Pp5jnXpQ6WOfydVE/xxNMDPKxXC DnXhFIlnsQ6S02JnvfDNgeMDTwRyQlm0M2fkF7Y/CcwJzJcKy6yq3NJlIY6iKGYyyjlr bfRKvYpZJVpjq3rxlXQ5vgCSWXBJZ34M/yO60c+EUADB9w6WPJ06HaYtK65WxQsXTrg1 4V+A7gD7EWsh2tA23/V8Wcb4z+MyQ/Oqk9k5aEuPgmnwnvicNLq9ggr9lmXELLUz2Zze z5Xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=7IDqL5TRSCZjRLpIL6vZ5DnuPgG95ymiO2xe/C2km9Y=; b=Sjs8McWLpzfnilyCvxcEYR++MgZeHdeUJpzbipSaASW72ZEVLTkToGIdhvDdFN3YFT nvKKbv1gi67VSPbfqLcJyqFxJaj83MZ6i1Rq1j61Oeh388D2td9YI7jkFAdDzFAB7s6z s4zBT7mH9XcUPilDPPn9BrS2n9EaXtC97TrOucUFVhgT4P0St+SKgClpAi0sF2JEx8sW PR409j4F40W6zMJnIa4zFWU0KTIjWIjJZVO7x63jzqyimaXvSRzYm2g/tnmokCLLLhFu FgMcvZ5e30D0r2iPkzQsRQrEpSxGJDpNVhRi/sk8BQk53Xfl9iBtYwAyBFe5HmliVcbZ 5Puw== X-Gm-Message-State: AElRT7EAv5kaz5jPw09CmnTTAyQIWhcNQVqJIZIU+7vD/3x9RSOw3vuD uqbTbOcmtf/QFaNtMFfZNBbFxzir2uCkP1FCq6i6/fX5xyjAQkrDB6ZpdMBPxVIKojcqSxBtdxH dpJLSeLf42mEvPFG8KpWR7SHQHT9NvWYhhBEJg+aiTCCmebobVdttDUCGkRPfGsaGJ2oBAfJ/2l rWTD1+NpTJ X-Google-Smtp-Source: AG47ELvSWpOJZ6TX//e9b+gfQk3+XRnI27ruo055oesk5Hwl+doZFT3YeLxyyTBsJf7xWcuDbnMDsg== X-Received: by 10.223.188.19 with SMTP id s19mr9857675wrg.213.1521749732260; Thu, 22 Mar 2018 13:15:32 -0700 (PDT) Received: from [10.137.2.19] (ip-78-102-97-226.net.upcbroadband.cz. [78.102.97.226]) by smtp.gmail.com with ESMTPSA id x10sm7342697wrc.64.2018.03.22.13.15.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Mar 2018 13:15:31 -0700 (PDT) Subject: Re: [HACKERS] VACUUM and ANALYZE disagreeing on what reltuples means To: Tom Lane Cc: David Steele , Stephen Frost , Michael Paquier , Haribabu Kommi , "pgsql-hackers@postgresql.org" References: <16db4468-edfa-830a-f921-39a50498e77e@2ndquadrant.com> <19990.1500936945@sss.pgh.pa.us> <3d250597-384e-c5f4-7533-b513e366888f@2ndquadrant.com> <94f58897-861b-accf-a9f1-af4be816c0d3@2ndquadrant.com> <13097.1509650125@sss.pgh.pa.us> <3dca6a76-fa4b-66ab-c0db-496335d650b1@2ndquadrant.com> <20180105042528.GK2416@tamriel.snowman.net> <1e831867-c46c-8f21-79d4-5de70cac5822@2ndquadrant.com> <13711.1515440364@sss.pgh.pa.us> <01387f5d-a95b-d159-becb-cf9ff9ba4e41@2ndquadrant.com> <8b29edcb-cbc0-5414-996f-520f75b94d3b@2ndquadrant.com> <3b3d8eac-c709-0d25-088e-b98339a1b28a@2ndquadrant.com> <14503.1521739732@sss.pgh.pa.us> <17044.1521748285@sss.pgh.pa.us> From: Tomas Vondra Message-ID: Date: Thu, 22 Mar 2018 21:15:27 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <17044.1521748285@sss.pgh.pa.us> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 03/22/2018 08:51 PM, Tom Lane wrote: > I wrote: >> Tomas Vondra writes: >>> The 0002 part is the main part, unifying the definition of reltuples on >>> three main places: > >> On to this part ... > > I've pushed 0002 with several corrections: it did not seem to me that > you'd correctly propagated what ANALYZE is doing into CREATE INDEX or > pgstattuple. Also, since one of the things VACUUM does with num_tuples > is to report it as "the total number of non-removable tuples", I thought > we'd better leave that calculation alone. I made the added code count > live tuples in a new variable live_tuples, instead. > OK, makes sense. Thanks. regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services