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 1hCFdp-0005a3-Ol for pgsql-hackers@arkaria.postgresql.org; Fri, 05 Apr 2019 03:35:45 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hCFdo-00053A-Cj for pgsql-hackers@arkaria.postgresql.org; Fri, 05 Apr 2019 03:35:44 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hCFdn-0004yf-Vv for pgsql-hackers@lists.postgresql.org; Fri, 05 Apr 2019 03:35:44 +0000 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hCFdl-0004hf-BU for pgsql-hackers@postgresql.org; Fri, 05 Apr 2019 03:35:42 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id D6CD6627F; Thu, 4 Apr 2019 23:35:39 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Thu, 04 Apr 2019 23:35:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm1; bh=KcprCHzEgoy19F/TdZ8RevrSdie 353dytpthotFQjz8=; b=izKLd8CSBPTCxkYtQpqBqXbBeq2eX+K+vfV5PH616lV N3P3mPK8rFYKYzLUb24y1UeA6aZj8PkOImizVVrWFAZG4VcaAlU1GXUKf89dpLbE Cd+4LAH+KmFs42MGQAfzj4JmyPUxo4gPtVvTutoPOrgMwvHXjWryJwZ6jCumbT/6 W6Ce8ltzlrq1xc160YBOZEIPmVIzS/tweAJlU1dd/CoHltDhvY7E1+eBehJ1bW5W TWDyGoUJObE6HWbtYBEoa40HPNrxlnDU8I2rksSRL9AXSY4Dp2tWaW7ZAZQpaVbf HSEV4s4vlVHbvWsTMSUmgX0IlopyG8Q9H0bHagxoBhA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc: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=fm2; bh=KcprCH zEgoy19F/TdZ8RevrSdie353dytpthotFQjz8=; b=mcsN+5jyXyuABPXTZNx6We Jdz40ATpwJsu2Z7dVgheN6KjaJQuGhhk1+ik89DXnRaET8/3t4uFG0Lz4XbkiwLr N2o/rBOezIbEbItlIt81xMes9stDCrslZRK+nGQ+9MijWXWmrTdMMMZ9LNZPjWCM 1bc0nH40qG6HWGE+E9s+89RaIcFrWtSsxX0L6DXvo8l+m8ZMSyEf5w6BW+pyywOj m1xT82nHysEHSGyMPsrW3cAkjXHEFR4DbXvfZAKoXSzEFURCzUktCyad5G6R3MLp OMzme8Zs3P2U1YXV3xEPvBLD3H93av8Lglv49m4HQo6NECDiBJJn7Omv763aLVMQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduuddrtdeigdeileculddtuddrgedutddrtddtmd cutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpeffhffvuffkfhggtggujgesthdtredttddtvden ucfhrhhomheptehnughrvghsucfhrhgvuhhnugcuoegrnhgurhgvshesrghnrghrrgiivg hlrdguvgeqnecukfhppeelkedrvddutddrudegtddrudejudenucfrrghrrghmpehmrghi lhhfrhhomheprghnughrvghssegrnhgrrhgriigvlhdruggvnecuvehluhhsthgvrhfuih iivgeptd X-ME-Proxy: Received: from intern.anarazel.de (c-98-210-140-171.hsd1.ca.comcast.net [98.210.140.171]) by mail.messagingengine.com (Postfix) with ESMTPA id 957E810316; Thu, 4 Apr 2019 23:35:38 -0400 (EDT) Date: Thu, 4 Apr 2019 20:35:37 -0700 From: Andres Freund To: Alvaro Herrera Cc: Pavan Deolasee , Masahiko Sawada , pgsql-hackers , Jeff Janes , Simon Riggs , Tomas Vondra Subject: Re: COPY FREEZE and setting PD_ALL_VISIBLE/visibility map bits Message-ID: <20190405033537.vklegbflesm2c7m3@alap3.anarazel.de> References: <20190404214520.7rfufsubxekodypr@alap3.anarazel.de> <20190405030604.GA3360@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190405030604.GA3360@alvherre.pgsql> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi, On 2019-04-05 00:06:04 -0300, Alvaro Herrera wrote: > On 2019-Apr-04, Andres Freund wrote: > > I still think this is the wrong architecture. > > Hmm. 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? Greetings, Andres Freund