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 1vOgvf-001We0-1L for pgsql-hackers@arkaria.postgresql.org; Thu, 27 Nov 2025 18:41:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vOgvc-007wg1-1l for pgsql-hackers@arkaria.postgresql.org; Thu, 27 Nov 2025 18:41:16 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vOgvc-007wft-0b for pgsql-hackers@lists.postgresql.org; Thu, 27 Nov 2025 18:41:16 +0000 Received: from mail-lf1-x134.google.com ([2a00:1450:4864:20::134]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vOgvZ-001n03-1Q for pgsql-hackers@postgresql.org; Thu, 27 Nov 2025 18:41:15 +0000 Received: by mail-lf1-x134.google.com with SMTP id 2adb3069b0e04-5957db5bdedso1323135e87.2 for ; Thu, 27 Nov 2025 10:41:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1764268872; x=1764873672; darn=postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=89ae4pVVfljq3+UrMKuF0CASmv6EORHpbeSSE1D50+A=; b=VuGfbZ8m62kU8W23n9xVcBs7CAo/hG7M8NlSC/myEsGD6E0kM+N3VXsTOjt3FmCOnO s5CKTGm6HgBFpuTwTboHann2BWp8y0jcHoqNft9XQi2qPxlre9tHlpXYy5hGqtEM1pmm vBBQaxN8gk78GYBuEN8wzAngF0ELBFHLW/vLUyES/kZab0S7m3ku39vu5Q2QLgiW93hk iIfeMgAhvjeYCncMsq33pnRd8m0p1tT+5FCdjU3GkKpXQeSzzl68+Ij+8UKb2Rucusel nU1sG4F/XjqCYcFDj8BqF9zi8UZvEQ7B2Kp5+Q07EKm7Dh8zNIHM4BdwNsdVuSX1zL4M ISpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764268872; x=1764873672; h=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=89ae4pVVfljq3+UrMKuF0CASmv6EORHpbeSSE1D50+A=; b=ZdjuXrRN+9ZSI0tnBdT6h9yed7iHy+vezR0s2RJFT3O1mAl5nbTxfLmKyCcG4RC6Iy qby/j1Bs0zN9ufjoiBTmqFI/aZoDc4N5ZE+mRbMjzpPahdUuuxXDuYi1u92XxCTwmLxG cH8bIhwa2YMqXri/ROvKkEsPOMVJ9/wtw72HV2Ztm1C3+p9nMTOP/DRlkTJdfesqVRTT DwMh6Wb9FMvXddNhvIjpJiUxQGko+qi/TXjMIgW9KXctSQP8P/l+317WuFGDCS73gXAK k3m5mxHcRER1fURr/WssV5rJlntEomonO+GJwoBJhMsISS8a/h4+3/DpN/5w23O5jo+T Thcg== X-Forwarded-Encrypted: i=1; AJvYcCVF7ftgcleY0aafik+pZH858c0K0j1o8P8UgPL5CXcP+lfpCwuJp3AMBwho0Vhv051ztBEmYk21T6UrTWat@postgresql.org X-Gm-Message-State: AOJu0Yzn5Dh6aTIgWFVTLxLSqT1kmm3RM1dbQqn5BoX2UWAZTQY8XXHU 905BxCo/FqtO/2s40KQbxsY/ySnSYa4ux9PQUtKl0E4grgwel5OZXYd8Y8SFlUCauv3rlVrcnMj 4vjceIltSph9joa3O35b/idHx2peINrY= X-Gm-Gg: ASbGnct3UnJ1z94ziJGiZzsgHhWctyq3NzTJkDP18CrCoWx5VcyHnaG62EWmi3+kujm Nx4w1ZW3IsRcqEN6Gu9RwbbVs56+lL8Pz+KALWhIf+Ot4PDQNkM2Q5JnWxvWEOwE53fwGxCTTnS 4EgdIFH5H925syPsZy2vw5m8PkNNWKPEeaNnyfHMs1EbUbLbULZCcmag9A7OES4SOpquPkluWvy 9McZ44L3S6EETpUJxRIG9y99mFX77pV64TJ3qi9UF+xOGFlrScs3fU9bosFuF/2Ivap2+DIFV+F aV8J0nnpRgO0D55rwifQUt9mAPogAQGTbUc+NGwIB9qbY/oErJfejcgza6kofYiY4rTmxkh14Xa 3TsM= X-Google-Smtp-Source: AGHT+IES+HA46QmzYKSC0w83nrZw+A9pMNrPqMnhPKp87quuK/V5JtN4twfqjwQ0Ef+7CcMVxd70JOpCMq6ddu5KJQ0= X-Received: by 2002:a05:6512:b17:b0:594:55a3:c191 with SMTP id 2adb3069b0e04-596a3eab707mr8814540e87.14.1764268872162; Thu, 27 Nov 2025 10:41:12 -0800 (PST) MIME-Version: 1.0 References: <202505181556.3n6oiowvntyr@alvherre.pgsql> In-Reply-To: From: Matthias van de Meent Date: Thu, 27 Nov 2025 19:40:59 +0100 X-Gm-Features: AWmQ_bn_IGQytd1Fukx40D9nHiUpC1KPDAu_O2jhBSg8U2028VhGgzxGgZFwxy8 Message-ID: Subject: Re: Revisiting {CREATE INDEX, REINDEX} CONCURRENTLY improvements To: Mihail Nikalayeu Cc: Sergey Sargsyan , =?UTF-8?Q?=C3=81lvaro_Herrera?= , Andres Freund , Michael Paquier , PostgreSQL Hackers , Andrey Borodin , Melanie Plageman , Matthias van de Meent Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Sun, 9 Nov 2025 at 19:02, Mihail Nikalayeu wrote: > > Hello! > > This is a rebased version. > > Also I decided to keep only part 3 for now, because we need some > common solution to keep the horizon advance for both INDEX and REPACK > operations [0]. I'm not sure a complete and common approach is that easy between CIC and REPACK CONCURRENTLY. Specifically, indexes don't need to deal with the exact visibility info of a tuple, and can let VACUUM take care of any false positives (now-dead tuples), while REPACK does need to deal with all of that that (xmin/xmax/xcid). Considering that REPACK is still going to rely on primitives provided by logical replication, it would be not much different from reducing the lifetime of the snapshots used by Logical Replication's initial sync, and I'd rather not have to wait for that to get implemented. The only thing I can think of that might be shareable between the two is the tooling in heapscan to every so often call into a function that registers a new snapshot, but I think that's a comparatively minor change on top of what was implemented for CIC, one that REPACK can deal with on its own. Kind regards, Matthias van de Meent Databricks (https://www.databricks.com)