Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1w4cOH-002N6Q-2l for pgsql-hackers@arkaria.postgresql.org; Mon, 23 Mar 2026 10:20:09 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w4cOG-00Guy6-13 for pgsql-hackers@arkaria.postgresql.org; Mon, 23 Mar 2026 10:20:08 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1w4cOF-00Guxx-3D for pgsql-hackers@lists.postgresql.org; Mon, 23 Mar 2026 10:20:08 +0000 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w4cOD-00000000enE-1sx7 for pgsql-hackers@lists.postgresql.org; Mon, 23 Mar 2026 10:20:07 +0000 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-4870206f73bso14553485e9.3 for ; Mon, 23 Mar 2026 03:20:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec.at; s=google; t=1774261204; x=1774866004; darn=lists.postgresql.org; h=message-id:date:content-transfer-encoding:content-id:mime-version :comments:references:in-reply-to:subject:cc:to:from:from:to:cc :subject:date:message-id:reply-to; bh=R0JVIWCWuGMjsRPUwfzOKldPdjoD2jApbg/i16jUau4=; b=Y35Ll7d0aXu36VCP4fVeJUGT1/13R5OxFyyEFMydT9XS7pvkAZILHFrZcJ/sZdXpSg ZJMS0gZvS4+S0CVvTTV6Idmf/ksMyebh4tWCgnOkrOqbpTlQI3XzK8gYfr0Zfq1wZDzN BBiVtOHlismdp+jl8Muagm+qd38M2pULFXj+mT0znb0ZVXGEGzFd+AOsWNDC2xDGTaK3 WxOXSMCDhD6/4jDi6JfgTN0My426SK0hoEFdj/w6XMqf9zBUvdByIyTAWi5EAxeJJY4D XLP9Zpbq+IQzoSG+kAIgMkztozqFA2dmYTCU7yAYKm/KfH7QLL2fRrpLaqZoZXar2t33 2prg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774261204; x=1774866004; h=message-id:date:content-transfer-encoding:content-id:mime-version :comments:references:in-reply-to:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=R0JVIWCWuGMjsRPUwfzOKldPdjoD2jApbg/i16jUau4=; b=RUtEnoKVf9MqzeSvQep6UbE+22V3Ejv8FPrP9E57wlrtf/6A9Vaiyr1kV05Z+eZx9h DpDF72yHWiE4zQUHwnEt8gJWb/t/hJ8FvlT7VVNLySm9dOOSQtpZgHDLcBABbC9jQb8v +JHXi53XXThad5Pmk0qEBPIZIxgSvZGHhyNa2wJK09cj2IW/0amUnm4ka6NC8ClpYLRP rIz8tycOWB6mv1dGUtrgNjcw1Y2Ss2rMQqvmiFlhJ93whBDQ+MMj6ysFK59Tts71Nhzn xb/dcmuX2oTCXGMpX6Uu6/dhbH4mzKMi6E453PHBEtoxbvJiqkUIY48g58fiFDQRX6uP f3iQ== X-Forwarded-Encrypted: i=1; AJvYcCXotaB/sOegVwbueZtpLLSRqyIjmfBuXd1zSyd8527Frr1nQtSksj1lOvibOlqvR0P4rMxDDADXcD6uTKd7@lists.postgresql.org X-Gm-Message-State: AOJu0YyQgxAdX3KGEd5NACkWM5yEBK1uCHyUKhP8UXLsL3oSso/4IR6r 26RuV/Xtwcg/j5Rwn8kFlxKDzkbTNkemVcGT3E3VutJa/tySDY5hpvjLErSaLrpYPzI= X-Gm-Gg: ATEYQzwYx/RdWRcOsZsAcnRZ1+D2IYrGqhjHLlP9tMoi6V8WbgBRjajaRyiiBfhoeiK cdijzPvKqo0CQNHQgWXov0Ex2e0irY35oKFLSwr9auZTL8bzTBXhthi+pSvKvITb/GuAzvJe2nL LwnXpW45VkgYlRorCSdB16huspGFQVFHyePGqiYxOZKJwrQ2YNpTQIywcqQXu353OreU4l0u0yY gLoQXIdLNcsy8sLM68esB1nLl0/CUiCcvEp1oFHlaHaQti5zklaKPROlr8tFL/QGrqXosMTTSzY 4aRnWzBz1V9FwxwJpEx54ncscWxO0tcmqY+qimKO9ow4iM/QtcyqrUV0Il81/29UzbzPGCFYQ3J 3Ps2mFEnY+owwPkyrWejZ3vH0N1i3gfEkak7MXjxy5enTT5lohfxN8n57N94KkQwxEn7N1pD+W2 vMsLzLbn5Wb9LXbk15c01q6TDi3P/kBoHXbkKH X-Received: by 2002:a05:600c:3d90:b0:485:3c8f:e4d9 with SMTP id 5b1f17b1804b1-486fee1d9e6mr130983295e9.26.1774261204464; Mon, 23 Mar 2026 03:20:04 -0700 (PDT) Received: from localhost (109-81-168-142.rct.o2.cz. [109.81.168.142]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4870a14f900sm28506375e9.22.2026.03.23.03.20.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Mar 2026 03:20:04 -0700 (PDT) From: Antonin Houska To: Alvaro Herrera cc: Srinath Reddy Sadipiralla , Matthias van de Meent , Mihail Nikalayeu , Pg Hackers , Robert Treat Subject: Re: Adding REPACK [concurrently] In-reply-to: <202603200752.zigubezzfcql@alvherre.pgsql> References: <202603200752.zigubezzfcql@alvherre.pgsql> Comments: In-reply-to Alvaro Herrera message dated "Fri, 20 Mar 2026 08:59:23 +0100." X-Mailer: MH-E 8.6+git; nmh 1.8; GNU Emacs 28.3 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <12104.1774261203.1@localhost> Content-Transfer-Encoding: quoted-printable Date: Mon, 23 Mar 2026 11:20:03 +0100 Message-ID: <12105.1774261203@localhost> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Alvaro Herrera wrote: > On 2026-Mar-19, Antonin Houska wrote: > = > > Alvaro Herrera wrote: > > = > > > So here's v43. Here, I've changed the CONCURRENTLY implementation t= o go > > > through table AM. This necessitated changing it to use tuples in sl= ots > > > instead of HeapTuple. This is good because we can avoid repeated tu= ple > > > form/deform, which could get pretty expensive. Antonin's 0004 patch > > > here looks suspicious here though, because it deforms the tuple and > > > forms it again, which sounds unnecessary now. > > = > > I suppose you mean > > v42-0004-Serialize-decoded-tuples-without-flattening.patch. This defor= ms the > > tuple to get the external attributes and to write them to file. The tu= ple the > > logical worker received from reorderbuffer.c cannot be passed to the b= ackend > > executing REPACK because it may contain "external indirect" attributes= , > > i.e. pointers to the worker's memory. > = > No, that patch has been absorbed in what is now v43-0003. I meant > v43-0004 "Use BulkInsertState when copying data to the new heap.", > that's why I said "patch 0004 here". In this patch, we have > reform_tuple which deforms the tuple, sets to NULL any attribute that's > marked dropped, and then forms a new one. This is wasteful and should > probably be done elsewhere, while the tuple is still in slot > representation. In fact, I suspect it may not be necessary at all > anymore. The idea to "reform" the tuple comes from VACUUM FULL / CLUSTER. I agree t= he "deform" and "form" steps are no longer needed when we use tuple slots. -- = Antonin Houska Web: https://www.cybertec-postgresql.com