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 1hG7ZO-0004bF-4G for pgsql-hackers@arkaria.postgresql.org; Mon, 15 Apr 2019 19:47:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hG7ZM-0007Q5-97 for pgsql-hackers@arkaria.postgresql.org; Mon, 15 Apr 2019 19:47:08 +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 1hG7ZM-0007Px-0q for pgsql-hackers@lists.postgresql.org; Mon, 15 Apr 2019 19:47:08 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hG7ZJ-00053z-Rq for pgsql-hackers@postgresql.org; Mon, 15 Apr 2019 19:47:07 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x3FJkwTR023886; Mon, 15 Apr 2019 15:46:58 -0400 From: Tom Lane To: Robert Haas cc: Masahiko Sawada , Kyotaro HORIGUCHI , "Bossart, Nathan" , Alvaro Herrera , PostgreSQL-development Subject: Re: New vacuum option to do only freezing In-reply-to: References: <20190403.131702.71087088.horiguchi.kyotaro@lab.ntt.co.jp> <20190404.091743.76975665.horiguchi.kyotaro@lab.ntt.co.jp> <15751.1555256860@sss.pgh.pa.us> <16814.1555348381@sss.pgh.pa.us> Comments: In-reply-to Robert Haas message dated "Mon, 15 Apr 2019 15:34:44 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <23884.1555357618.1@sss.pgh.pa.us> Date: Mon, 15 Apr 2019 15:46:58 -0400 Message-ID: <23885.1555357618@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Robert Haas writes: > On Mon, Apr 15, 2019 at 1:13 PM Tom Lane wrote: >> I have a very strong feeling that this patch was not fully baked. > I think you're right, but I don't understand the comment in the > preceding paragraph. How does this problem prevent tupgone from > getting set? My point is that I suspect that tupgone *shouldn't* get set. It's not (going to be) gone. > It looks to me like nleft_dead_tuples should be ripped out. That was pretty much what I was thinking too. It makes more sense just to treat this case identically to dead-but-not-yet-removable. I have substantial doubts about nleft_dead_itemids being worth anything, as well. > We should do something like: > if (params->index_cleanup == VACOPT_TERNARY_DISABLED) > { > nkeep += tups_vacuumed; > tups_vacuumed = 0; > } No. I'm thinking there should be exactly one test of index_cleanup in this logic, and what it would be is along the lines of if (HeapTupleIsHotUpdated(&tuple) || HeapTupleIsHeapOnly(&tuple) || + params->index_cleanup == VACOPT_TERNARY_DISABLED) nkeep += 1; else In general, this thing has a strong whiff of "large patch with a small patch struggling to get out". regards, tom lane