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 1hCFzT-0006kC-W4 for pgsql-hackers@arkaria.postgresql.org; Fri, 05 Apr 2019 03:58:08 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hCFzS-0005rQ-NH for pgsql-hackers@arkaria.postgresql.org; Fri, 05 Apr 2019 03:58:06 +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 1hCFzS-0005rI-EW for pgsql-hackers@lists.postgresql.org; Fri, 05 Apr 2019 03:58:06 +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 1hCFzQ-0006HR-9f for pgsql-hackers@postgresql.org; Fri, 05 Apr 2019 03:58:06 +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 x353vwLx000960; Thu, 4 Apr 2019 23:57:58 -0400 From: Tom Lane To: Andres Freund cc: Alvaro Herrera , Pavan Deolasee , Masahiko Sawada , pgsql-hackers , Jeff Janes , Simon Riggs , Tomas Vondra Subject: Re: COPY FREEZE and setting PD_ALL_VISIBLE/visibility map bits In-reply-to: <20190405033537.vklegbflesm2c7m3@alap3.anarazel.de> References: <20190404214520.7rfufsubxekodypr@alap3.anarazel.de> <20190405030604.GA3360@alvherre.pgsql> <20190405033537.vklegbflesm2c7m3@alap3.anarazel.de> Comments: In-reply-to Andres Freund message dated "Thu, 04 Apr 2019 20:35:37 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <958.1554436678.1@sss.pgh.pa.us> Date: Thu, 04 Apr 2019 23:57:58 -0400 Message-ID: <959.1554436678@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Andres Freund writes: > I think the right approach would be to do all of this in heap_insert and > heap_multi_insert. Whenever starting to work on a page, if INSERT_FROZEN > is specified, remember whether it is either currently empty, or is > already marked as all-visible. If previously empty, mark it as all > visible at the end. If already all visible, there's no need to change > that. If not yet all-visible, no need to do anything, since it can't > have been inserted with COPY FREEZE. Do you see any problem doing it > that way? Do we want to add overhead to these hot-spot routines for this purpose? regards, tom lane