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.94.2) (envelope-from ) id 1uqaSX-00960m-60 for pgsql-hackers@arkaria.postgresql.org; Mon, 25 Aug 2025 16:54:18 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1uqaSW-00Bfvs-Ju for pgsql-hackers@arkaria.postgresql.org; Mon, 25 Aug 2025 16:54:17 +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.94.2) (envelope-from ) id 1uqaSW-00Bfvk-9V for pgsql-hackers@lists.postgresql.org; Mon, 25 Aug 2025 16:54:16 +0000 Received: from mail-ej1-x62c.google.com ([2a00:1450:4864:20::62c]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uqaSU-001nIW-0G for pgsql-hackers@lists.postgresql.org; Mon, 25 Aug 2025 16:54:16 +0000 Received: by mail-ej1-x62c.google.com with SMTP id a640c23a62f3a-afcb73621fcso621961866b.0 for ; Mon, 25 Aug 2025 09:54:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec.at; s=google; t=1756140853; x=1756745653; darn=lists.postgresql.org; h=message-id:date:content-transfer-encoding:mime-version:comments :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=FW2KeyApsAfR5zFAAFtELRlLGv1aKiQ4/MfI2Vj7vZY=; b=GU6gBPz+62gHeKsSyugBiqplF64y6h0BcN+fCdT38+kl8OttjBDWvpI6+h0sO+MOhb y/3Yvu0CyCzM92KHRUWutoEIbXz5L60JdCU2EdF2nPijiIK5CmY3/79qo6nhGcz+sHHP YaaffwXfht9hGw9jnvpkZQxsbK7hIvzBoXJA4l4DtB9NUH/71EBZCCwTZFkIRdhS4zFW rCdKdm79TG/k5Nwtu7SfgoDZrKRo5Ns8S1XpFymC4E4pwxPGxKZ/hFD6cutnqAyd1X31 cHjniZf79NFrqwYswvgsaX6winM345Ez8NdyeNq7+U25aSh75I4cPc9kruWW66j43lHL ao5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756140853; x=1756745653; h=message-id:date:content-transfer-encoding:mime-version:comments :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=FW2KeyApsAfR5zFAAFtELRlLGv1aKiQ4/MfI2Vj7vZY=; b=mdEC3VuFPie4UH5YHERYp9thi+GfUbaEnV4f78o5/SM4d0JSZPHZb2fa/RXC//giFJ JsDNieVZUB+1+16Lsu5taR5glH+oJSI2q9+01t7Rs6gNj46sqhR9moB8ie4xh8xjgQbE DDYkVdDjJkxILLEpWVXMAtpHhygcuqIjoXitIuSrYewa5yhFFKM9bH6ar9qelRYZ8UOF 7j0RVEMXdMwbni+xzMMjN9bDIn/ZoxnvNo3C+KvEL2zZZkh9O+ebbW86TtTnwMByX1FY FUXgOxRexvw+qR2XPKyJTyOKj3w4Krz3IaXUReROvxS0pZWRKJkwsd4klMviVI4/Gmca yrMQ== X-Forwarded-Encrypted: i=1; AJvYcCVQLwcrahwu4NebjpUzamnVzc4bt7rTGr5zRvIWZ7NChXQhG781YcpKerljraqEk6OOH1Q3Hc3ckv2ETglR@lists.postgresql.org X-Gm-Message-State: AOJu0YwDY+AwuKFPEVM7n+07Dc0A3cX4YNyP9PUI8g6myyc/kvMYQ9p2 kS/kltnxJPrHbySI5meSClIOOMYaV4tLrpAPjMfiOOydzASWLQR3sewrNSNSKWO4nv4= X-Gm-Gg: ASbGnctto2h+Z5cOuHv4Fj9jKpJhhKT+cYTVGOzP895SMkan0pMNtRNgdKCfwx0lBdH zz6EjDGVsre69x/Z5kP5Nq1lDZXVQ641DBlJ4dEn6PAMGMtc/I5aMM6+BiUxz8hj6LHVpDfLqXt 68V3Yapf7Mc19r7CzhUW1si05iXOholL4fL1kbW8tzNd4SJqW6i+Ubqy6JWRYJP2EZdNaPBZYSZ HN5OseziDg42stPjXfcgZK07uLMUGpRrB9YpnApVEPbH905WOsXkZSw6lPU0GI4oyyVK6t1rK8o buVJdFeXbwMVCp2IuyHXKwuQFBSz5qYSp7PLMGRLIQ4ZJY6QJMIREx6vpQdvv9R3UKSpxn2Rjyb WWq/niDkZuPvCdD3pdznNVAQx4Mm44UYB2KkG9YkiF/k43DA= X-Google-Smtp-Source: AGHT+IGoLUoyjfm8W5MumZaVi7kTpBugnIPdAC+337thUd+2yCkqmIRTcB9cDlYtG0t6geDgE+ZmtQ== X-Received: by 2002:a17:907:3f1d:b0:afe:9172:b8b5 with SMTP id a640c23a62f3a-afe9172bdaemr186645266b.51.1756140852948; Mon, 25 Aug 2025 09:54:12 -0700 (PDT) Received: from localhost (109-81-168-144.rct.o2.cz. [109.81.168.144]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-afe492da4b9sm592510066b.63.2025.08.25.09.54.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Aug 2025 09:54:12 -0700 (PDT) From: Antonin Houska To: Robert Treat cc: Mihail Nikalayeu , Alvaro Herrera , Fujii Masao , Pg Hackers Subject: Re: Adding REPACK [concurrently] In-reply-to: References: <202508091333.qvgvo7ikuezm@alvherre.pgsql> <40729.1755799624@localhost> <9536.1756127358@localhost> Comments: In-reply-to Robert Treat message dated "Mon, 25 Aug 2025 12:36:10 -0400." X-Mailer: MH-E 8.6+git; nmh 1.8; GNU Emacs 28.3 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Mon, 25 Aug 2025 18:54:12 +0200 Message-ID: <23676.1756140852@localhost> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Robert Treat wrote: > On Mon, Aug 25, 2025 at 10:15=E2=80=AFAM Mihail Nikalayeu > wrote: > > 1) we have a whole initial table snapshot with all xmin copied from > > the original table. All such xmin are committed. > > 2) appling transaction sees ALL the self-alive (no xmax) tuple in it > > because its xmin\xmax is committed and SnapshotSelf is happy with it > > 3) each update/delete during the replay selects the last existing > > tuple version, updates it xmax=3Doriginal xid and inserts a new one > > keeping with xmin=3Dorignal xid > > 4) --//-- > > 5) --//-- > > >=20 > Advancing the tables min xid to at least repack XID is a pretty big > feature, but the above scenario sounds like it would result in any > non-modified pre-existing tuples ending up with their original xmin > rather than repack XID, which seems like it could lead to weird > side-effects. Maybe I am mis-thinking it though? What we discuss here is how to keep visibility information of tuples (xmin, xmax, ...) unchanged. Both CLUSTER and VACUUM FULL already do that. However it's not trivial to ensure that REPACK with the CONCURRENTLY option does as well. --=20 Antonin Houska Web: https://www.cybertec-postgresql.com