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 1vOiHS-002WBr-1R for pgsql-hackers@arkaria.postgresql.org; Thu, 27 Nov 2025 20:07:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vOiHO-0089ZY-2z for pgsql-hackers@arkaria.postgresql.org; Thu, 27 Nov 2025 20:07:51 +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 1vOiHO-0089ZQ-1k for pgsql-hackers@lists.postgresql.org; Thu, 27 Nov 2025 20:07:50 +0000 Received: from mail-lj1-x233.google.com ([2a00:1450:4864:20::233]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vOiHM-001ne2-0U for pgsql-hackers@postgresql.org; Thu, 27 Nov 2025 20:07:49 +0000 Received: by mail-lj1-x233.google.com with SMTP id 38308e7fff4ca-37a875e3418so8400881fa.1 for ; Thu, 27 Nov 2025 12:07:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1764274066; x=1764878866; 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=hCe70u+uBcx6WhKS7KVepW1u1fXwxpK4b2nPsSGpWuA=; b=DkYxMoqyIAtUXNvvpGLBPZFHUr3yvGh9JPD+epw9rLRL8mUCp7E8vKCV293DgSv+BD j3ckJoMfPJ9sR+mKecl5zJhpEb9W/dXkZZk3sIu0GYdk5xYBOi64b4/7fl80W6d6Vm/B 9piOi2hLBShFGx40rq+kkTkeCXgHyOOsLyNf0psPDvZ6A5OS6v4moeqWPpeIlA8qIEhD sMIDTAnXeYsF1gKxtpWa90ZCS7KVS83rnIyC8jzbAVFmpO9WymZxF86QTobPJhEjvW9+ kWn/DCmf+xHtaT1pBx0T7G5TT4+gHvYslI9Z9hy3U/n1gBfCrHy/piULgHbGvht1ghKW k/OA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764274066; x=1764878866; 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=hCe70u+uBcx6WhKS7KVepW1u1fXwxpK4b2nPsSGpWuA=; b=XGTYlJgpWWCB4wLulrUDyHwJkm/X/VR0uK8+l1cTnItHxwPSd0jt/IIBe+IBEeOeXX cRbRDJ0O4trZhm0RnGkS/FrtaYKk05SGza/yU/0vXEP9bh/YpCsVqS4cCFa8EbeSu5mx Wjj09aNEv+0x7Z9YyoULVU7XK6EYp6QXi4KEcqoNT8kMaAqec4jGtZcUOumvfh+1ukbZ tOsy5RUm+jNnRcBEliyjzZqhsRuKy2TETK8/BiqWhkCe05p5spAeER6AlKH0YvVVwHsO Dl5R+5PGh7Xk69Oc0LCrAYP3hVg3zg+abngtkjFHbdKCL1Hmm29KsmiCUxSPH253sZy2 Qn8g== X-Forwarded-Encrypted: i=1; AJvYcCVoN6xr5wYubepAj7/emvdyfuft9ANzHAmA9JrgnJUDN1sDYTZyYSNvCZlQlSn8oFXwT9XFTYrLZLTJLSXs@postgresql.org X-Gm-Message-State: AOJu0Yy4SEq/npMli6F2wM6ERV5L1qLV9CJ2V12zyXUi5+Dk/IS/mCDf mWZmbUGer9coSRJWpiG67hb0qr6trbMdUTzqPA20xdPlQ2PDH9KjC3zxR5QSfBr9m0FlMQC9iM3 qhC2/xPugiZOjzXgvNWBW8HwSKOTjahM= X-Gm-Gg: ASbGncvvfrCHiVPp5TVeD4lfAW+yhIK+W04PELeP+wECSzWuUJs4dCeZhV3R8w9RAjL jA/XEA/ds3/OhSBtzoSn/gaWD+af4Ll+iemWCqKrvVoJY/zFueYtD68QvTZkwDU+cgdreOQz1yi k54BX2lj0QWHH/liBrJ04jzLEFGr4ByLxZN4po6OV+mCNt0GRbMxUWPoFUhqjSl7124Inlz9jMx uN1IcGXKkzrTwI/A0/PCh5n2vwb5rMl7t+Muruyxwb/HRz9koDlaUWRnRqxOw02OgWJclccga4S 03rBveFa2m2AEMYSYX4hzN2yJnRUt8HYxMwNwoslG8Pby+hLLyouLhZxVJYZDeHaY3IY X-Google-Smtp-Source: AGHT+IFj4DFv8kdZEfCwofcb45QCqtK+FeFyoUpxZRIm+1wkqVcR9MQvAELTbX+L3uSUHEHo9Qm4sVPrMS4kKYxcFTA= X-Received: by 2002:a2e:9e8c:0:b0:37b:aaf7:f022 with SMTP id 38308e7fff4ca-37d0790ff42mr21248391fa.35.1764274065683; Thu, 27 Nov 2025 12:07:45 -0800 (PST) MIME-Version: 1.0 References: <202505181556.3n6oiowvntyr@alvherre.pgsql> In-Reply-To: From: Matthias van de Meent Date: Thu, 27 Nov 2025 21:07:34 +0100 X-Gm-Features: AWmQ_bnc2oXceIa2Kiq9Pk90Lr_VxOVC_E61jQVXd2UWysMs_x6ybf_wZ3AN2Ew 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 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 Thu, 27 Nov 2025 at 20:00, Mihail Nikalayeu wrote: > > Hello, Mathias! > > On Thu, Nov 27, 2025 at 7:41=E2=80=AFPM Matthias van de Meent > wrote: > > I'm not sure a complete and common approach is that easy between CIC > > and REPACK CONCURRENTLY. > > Yes, you're right, but I hope something like [0] may work. While it might not break, and might not hold back other tables' visibility horizons, it'll still hold back pruning on the table we're acting on, and that's likely one which already had bloat issues if you're running RIC (or REPACK). Hence the approach with properly taking a new snapshot every so often in CIC/RIC -- that way pruning is allowed up to a relatively recent point in every table, including the one we're acting on; potentially saving us from a vicious cycle where RIC causes table bloat in the table it's working on due to long-held snapshots and a high-churn workload in that table. Kind regards, Matthias van de Meent Databricks (https://www.databricks.com) PS. When I checked the code you linked to on that thread, I noticed there is a stale pointer dereference issue in GetPinnedOldestNonRemovableTransactionId, where it pulls data from a hash table entry that could've been released by that point.