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 1w0xca-002MiA-0p for pgsql-hackers@arkaria.postgresql.org; Fri, 13 Mar 2026 08:11:48 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w0xcX-002SFw-1d for pgsql-hackers@arkaria.postgresql.org; Fri, 13 Mar 2026 08:11:46 +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 1w0xcX-002SFo-0d for pgsql-hackers@lists.postgresql.org; Fri, 13 Mar 2026 08:11:45 +0000 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w0xcU-00000002QiS-3NwC for pgsql-hackers@lists.postgresql.org; Fri, 13 Mar 2026 08:11:45 +0000 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-4852b81c73aso15917035e9.3 for ; Fri, 13 Mar 2026 01:11:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec.at; s=google; t=1773389499; x=1773994299; darn=lists.postgresql.org; h=message-id:date:content-id:mime-version:comments:references :in-reply-to:subject:cc:to:from:from:to:cc:subject:date:message-id :reply-to; bh=3v4ORPRL7WrnOIvhbTs0X4CwrIBbEG9l6POU2DYZSKc=; b=NcJVRmNhRegBPlfIcUBY95EvSFs8k0dB9CPkCLjDYwEvgNOnGkDsRwhvgWceRrDSb3 ZM6iHAEQyvmIB10Y3ajrAdKMa6tPVObkjT+05MdXnJ8QSQsrZgygMpT49R5IfdwwUbMF mVYYiWO3O57ZLBnHePj3Cub5+uUpxgUxJh/pqmOerZ63MNnT+A9+HPmISniBJfEAXTbH saNptNv/9kxKcC8n9NWNPOGiUkQn0W4JbnkqXVuEOAH4qsl6S0+Wcpl5YxUGKm2RZ8h2 Q5+POTvBbYqjsAVxtA5AZhGt9FstZMibFSSPSgBoQU17SUwnTM9iynu2vGVNaFzi4glk ZFRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773389499; x=1773994299; h=message-id:date: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=3v4ORPRL7WrnOIvhbTs0X4CwrIBbEG9l6POU2DYZSKc=; b=dDoaB6hHADsx316fOhQzpf8A/BJC7TNLyuD6G2tV2b1hzSb6sE947pB3XGrtBCUzBW 6amuOELXZ/xh7xtWqPq/81NQqZzhPx9Wg2bRIfZpTJC7tr4oqpb++351zO6ZLTOLueCZ D2iX8rdkeVcNeqfZ6QBSh4JZx47V/OVzsZrqgTnFzJD6UCfZ1TUn/kUK27eIGQsq7SEF cpVlI/z+J4q8WLMFRuv0xcZGqp7zC1x9NDrlnTi/tzWfgSP6NVUTIIIffOoA34IkERNS 1cBT0ImmCY8lWbp6TUnAjEj0f1KsdtFsycIj4KjAHuJAm4oBAP9Xr3sk2fT3MvvvKP+s lotg== X-Forwarded-Encrypted: i=1; AJvYcCWsATCd9sKFJ1mTyJtJkj5XrMRvIbm3zbfV9hg5uT+ULGnnJWJBcLFsoHge+V3NxsHnlhmGekQEiLd771r7@lists.postgresql.org X-Gm-Message-State: AOJu0YzkLCUEKbwKQsJ/s8RfgxOJce4GtSKPU9JJMzsXWK4n5CRa+kdc hc3KpPK3ZEXjejgzt1snd6cMbMhEpl1Ymw2LiTMBpzf/GYdpcH4DCtzXrPwF0WzEZIs= X-Gm-Gg: ATEYQzwyN3HycAT3z0g5AEvDHfroZHWIdHDWf0bh4KWHU9iT+wGYBimQt7aAjkbKfHO 3CUxQe79ig1b2WEJFDgy3w/PGaluoW0GkfgLX2xPaOwhS/OZNFz0mhOJu0vH4TEL+MOtphWTh3C lMgsJsBfqEirMD/1Pnd3WY7lQkUcldzzoKXdiO7Qxs4yR8h+WcN6wB6SB9TbTcOtwrKAHN9XRmv DDvKeVp3UPipQFoUkeOQWqByk+3hs5A3DVCkk3KxTXCw2UiVtb3UqoxCnJyh4pjNmn6i+fOzqw6 ofqywJV42hNQ+DfKJMoengcyr3yZX7PwBoygfNHZXMUiygy4moMhrPlUUlz1JSjDnll3zCTYo90 P+5MIhi8ogVd4akSL9l/9qmQ1Gli7UkDex99aH0yblfKNBxhaU3Skw+HysMswoIub8J6bjUx+nK 9Z2hBXIlPKofW4rwtti2m+jSYUtY9ntnH9P/yz X-Received: by 2002:a05:600c:a011:b0:47e:e952:86c9 with SMTP id 5b1f17b1804b1-485564981e5mr33989585e9.0.1773389499408; Fri, 13 Mar 2026 01:11:39 -0700 (PDT) Received: from localhost (109-81-168-142.rct.o2.cz. [109.81.168.142]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4854b6756e4sm221473155e9.15.2026.03.13.01.11.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Mar 2026 01:11:39 -0700 (PDT) From: Antonin Houska To: Alvaro Herrera cc: Mihail Nikalayeu , Pg Hackers , Robert Treat Subject: Re: Adding REPACK [concurrently] In-reply-to: <202603121839.7ttist64mas5@alvherre.pgsql> References: <202603121839.7ttist64mas5@alvherre.pgsql> Comments: In-reply-to Alvaro Herrera message dated "Thu, 12 Mar 2026 20:31:40 +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: <8348.1773389498.1@localhost> Date: Fri, 13 Mar 2026 09:11:38 +0100 Message-ID: <8349.1773389498@localhost> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Alvaro Herrera wrote: > I offer the following rather trivial fixup diffs, which I think should > be mostly be for 0002. Thanks, just a few comments: * 0002 - I didn't add the 'repack_' prefix because the function is static, but realize now that it might be useful from the code browsing perspective. * 0008 - It's possible during query execution, when you know exactly which attributes you need to fetch from the tuple. However in store_change(), we don't know which attributes are external (indirect) without deforming them all. > Other trivial things I'd like to change, if you don't mind, > - the name pgoutput_repack sounds wrong to me. I would rather say > rpck_output, repack_output, repack_plugin, ... or something. I don't > understand where the suffix "output" comes from in the name > "pgoutput", but it sounds like arbitrary nonsense to me. No strong preference here, except that I don't like "rpck_...". How about pgoutput/repack.c? I think I tried to put the plugin into the existing "pgoutput" directory at some point, but don't remember why I eventually rejected that approach. > - I would rename the routines in that file to also have the name > "repack", probably as prefixes. ok > One thing we need and is rather not trivial, is to go through the table > AM interface rather than calling heapam.c routines directly. I'm > working on this now and will present a patch later. It occurred to me too, at least because copy_table_data() calls table_relation_copy_for_cluster() rather than heapam_relation_copy_for_cluster(). Thanks for working on it. > Another thing I noticed while going over the code was that we seem to > spill whole tuples even for things like the old tuple of an UPDATE and > for DELETE, but unless I misunderstand how this works, these shouldn't > be necessary: we just need the replica identity so that we can locate > the tuple to operate on. Especially for tuples that contain large > toasted attributes, this is likely important. I think we don't need to care, as both heap_update() and heap_delete() call ExtractReplicaIdentity(). That returns a real tuple, but it only contains the attributes constituting the replica identity. The other ones are set to NULL. > It may make sense to use the TupleTableSlot interface rather than > HeapTuple for everything. I'm not really sure about this though. Isn't this part of the adoption of table AM? For example, table_tuple_insert() accepts tuple slot rather than heap tuple. -- Antonin Houska Web: https://www.cybertec-postgresql.com