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 1vP3Fm-0021eu-0t for pgsql-hackers@arkaria.postgresql.org; Fri, 28 Nov 2025 18:31:34 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vP3Fk-00D01T-2c for pgsql-hackers@arkaria.postgresql.org; Fri, 28 Nov 2025 18:31:33 +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 1vP3Fk-00D01K-1Z for pgsql-hackers@lists.postgresql.org; Fri, 28 Nov 2025 18:31:32 +0000 Received: from mail-lj1-x236.google.com ([2a00:1450:4864:20::236]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vP3Fi-00222t-2G for pgsql-hackers@postgresql.org; Fri, 28 Nov 2025 18:31:32 +0000 Received: by mail-lj1-x236.google.com with SMTP id 38308e7fff4ca-37b95f87d64so19288541fa.2 for ; Fri, 28 Nov 2025 10:31:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1764354689; x=1764959489; darn=postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=B6mu/XYwYCYgKPK2c9LD3rVE+03N19952hXbrVjrfPg=; b=BRyVIgUSjhMkUtms4dnkBbPSbQFFuh4RtrgTY/iE+euoCSe+ljCMYTnng2VwEsJAJE Ox4j7pC41Z98aSvvHeC2HN0kdrL9K9DOceFh6LwBxcz2sb+ZwaiAiUxVzV+cPioxPIDZ SC3nQFga9zN9SV2Uy9qfSBMqTfk600lhKPVmfflQRrZftCbevZFV/MXjlLHKUAw9TFWh nkpJhapB6lIhOi3b3ENULGl6v/nYaGdLphOMR3Qi8DDhn0EV+ylp8T8v+ZF7CaSTKZjm hlVvh6cmONNBlAZc4jED24b2u1yV+Oeu0ZEH7o6LuSPJKimEO8n6Q7w95/g45XNdXwhD QfTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764354689; x=1764959489; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=B6mu/XYwYCYgKPK2c9LD3rVE+03N19952hXbrVjrfPg=; b=Nh0EoNBZhQFhkWQOMHMyv4sVhxJfcD8L/9asGHrG6PdS6V9JLzNB63kT1FGUyet4dV YZ5HbhEIxkb69so5fjSO+J2NmB22dLmWcpThYRGp+stxAi7aQuVr5aqfSfwTHJ2biwDI 0SfjYqwKCtPfACNfySs7aZZexAMbWMxVXjaNam2cS5kMk+cN9hI2OC0cbxB8b4/9ojUT UkRp8s+g6xrSWBtgt7YxqtFkXgPEPG3EpcKbI158a9UHWZJeCGv20uBXmniAI/1GZc5o 5PQhwQ0ilcZvpykKjtR/gTmRKRH5OLsafChqlyERzED3pPHMmfKUHoF9rN1Mgmcd7zep 0MTQ== X-Forwarded-Encrypted: i=1; AJvYcCWw6SuxKGA9JLMeqTnOmqABNMj7m6Z2QlZViVFZIXlfo/01wyEbegjie2coAVIgP55fGr/HcWLZtKYDtLU4@postgresql.org X-Gm-Message-State: AOJu0Yz4nsTeTWKtlcGNSFKBSWjpPmiw2MK/THnbDBTZisbDyuGZ6pHq DC8jyxrWtACpPdZPWj1AWXNGQZOyZ+l3uJW8t2j9WfHJlXKpqMtYbaqrKg3UDn9zmfW4HxnKb9Z 95/0eq6JjMzh6DayeVwFtkmde6/ruz8I= X-Gm-Gg: ASbGnctkz33vOm3RdIX5uV9z8HTUQ9xLh1cMY9pK9E+zCxvn4YUc2ezeJUfjmH9Ri0g 7MT/bHPedKJZQW8ueFVr1mNz1mTEm02Rpl/HU8ZmPW/hpFGpT0yZnLywOQVKVyczWOcVmERLBMc DHFHjRzTz710t4aKa3auIYrYGb0aFIdJ6+Egf78y7fFeYFqdyNCQk9fwrl7l1xOUHz8Ajt7nJ2R W3nCFdKAK0XMzRIMB0n0aD6BlroKf8HInBwR0dX8+dZ0b+w9EBrN/7cIn9IE6ECiNMA8KRD5zoY TuozwT+EB67yxBmJlbzgiPq+DcFvTu+2FgZzaCfP2I5GOEPngRg6WoJE7lwlQXOhn5hp X-Google-Smtp-Source: AGHT+IEjQhVP3U0SRkvagv1dnOmwgkizhAzvLtRZ8wV142Rs43dP7UaItVrw5MNjt9f+r2ixCPh8quwjzRm8ezHtilY= X-Received: by 2002:a2e:8a98:0:b0:37c:dc91:6287 with SMTP id 38308e7fff4ca-37d078bc289mr42116661fa.36.1764354689145; Fri, 28 Nov 2025 10:31:29 -0800 (PST) MIME-Version: 1.0 References: <202505181556.3n6oiowvntyr@alvherre.pgsql> In-Reply-To: From: Matthias van de Meent Date: Fri, 28 Nov 2025 19:31:17 +0100 X-Gm-Features: AWmQ_bkPsTh7BPHlGqT1fU2iiZxGl0tupuwRJu6akkIK39kIRhNARd4xVj_rODY Message-ID: Subject: Re: Revisiting {CREATE INDEX, REINDEX} CONCURRENTLY improvements To: Hannu Krosing Cc: Mihail Nikalayeu , Sergey Sargsyan , =?UTF-8?Q?=C3=81lvaro_Herrera?= , Andres Freund , Michael Paquier , PostgreSQL Hackers , Andrey Borodin , Melanie Plageman Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri, 28 Nov 2025 at 18:58, Hannu Krosing wrote: > > On Fri, Nov 28, 2025 at 5:58=E2=80=AFPM Matthias van de Meent > wrote: > > > ... > > I'm a bit worried, though, that LR may lose updates due to commit > > order differences between WAL and PGPROC. I don't know how that's > > handled in logical decoding, and can't find much literature about it > > in the repo either. > > Now the reference to logical decoding made me think that maybe to real > fix for CIC would be to leverage logical decoding for the 2nd pass of > CIC and not wore about in-page visibilities at all. -1: Requiring the logical decoding system just to reindex an index without O(tablesize) lock time adds too much overhead, and removes features we currently have (CIC on unlogged tables). wal_level=3Dlogical *must not* be required for these tasks if we can at all avoid it. I'm also not sure whether logical decoding gets access to the HOT information of the updated tuples involved, and therefore whether the index build can determine whether it must or can't insert the tuple. I don't think logical decoding is sufficient, because we don't know which tuples were already inserted into the index by their own backends, so we don't know which tuples' index entries we must skip. Kind regards, Matthias van de Meent. PS. I think the same should be true for REPACK CONCURRENTLY, but that's a new command with yet-to-be-determined semantics, unlike CIC which has been part of PG for 6 years.