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 1rckuQ-001tMD-2g for pgsql-hackers@arkaria.postgresql.org; Wed, 21 Feb 2024 11:37:06 +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 1rckuO-004Jdi-J5 for pgsql-hackers@arkaria.postgresql.org; Wed, 21 Feb 2024 11:37:05 +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.94.2) (envelope-from ) id 1rckuO-004Jda-A6 for pgsql-hackers@lists.postgresql.org; Wed, 21 Feb 2024 11:37:04 +0000 Received: from mail-ej1-x634.google.com ([2a00:1450:4864:20::634]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rckuK-000G0c-VZ for pgsql-hackers@postgresql.org; Wed, 21 Feb 2024 11:37:03 +0000 Received: by mail-ej1-x634.google.com with SMTP id a640c23a62f3a-a26ed1e05c7so891943266b.2 for ; Wed, 21 Feb 2024 03:37:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708515420; x=1709120220; 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=V4rV49LqgMI15fX+6bKjmB3BR2USS8f+pdSrmdgYwdY=; b=TCOSVNiltdTe2aBiSmrhzwiXQmSAWA0NBkW1nUQCUvCXK8RqkHXaiuM6mVyLNrufdk TUdkUuxt/SP+axtVR28mqNEGxUd6TKUWVZADVK+W99X6Bu6RJL3ratwXQicrl8cyzxoI TDy24MhOSEPGFDexUtZ3fMmxq/Gl15MiUydfkrvaLP7gn3Qo/tt/CtjDaUC3/E/CYqj/ vNMzHZPlP3Y+mbfBWTv4ZlRI5xRTx/UFKo8CVxOc7F5PFGts4dXTN4ChhEUQxpKjj1P+ AlEAOh5HMxigJc0fHTcgPtFNcBCVZkFB098IoZnuqZC6mYBk/+vRhePIV40jlAhHoTSp sObw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708515420; x=1709120220; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=V4rV49LqgMI15fX+6bKjmB3BR2USS8f+pdSrmdgYwdY=; b=mORu9AkcFzYmTp9pKw4MwxF1aEgUvoGMnyeLKDSnuEZnnmvYP7BI3uBoFL9zIeAXQH cxdAzG+369MF3gzK+I2gdh/sDl0m9OnfJHR8xszTAXr9nAh57tSII/PReAuUsFoHAQBI O3y1+gqvf/xqwHvJZ88PiixZbTtTzyDU3MKGlxczaKYkBzxIDb/a8C9R4jah21DQi6v2 xOdl4NuBFNRIbTXF90ugA5qRreBio9fwGCnJeR+Dw63rFqh8ZWGWaySXa2MnTy+dYvx+ lg1adRWGT2iMzTUN/TbsyTbcxgGO0L8pnrrbzY66ISQMaZIsBE+Mpn0CavzkVIDLPia8 H5/A== X-Forwarded-Encrypted: i=1; AJvYcCVAkSPLFPff8Tldr3brsbyrCTbusLLPLejZNt/eNP/m7mTxyc80XxhUwdkUPqqNhVy61+wMkyBgpX9CVoT94XZqYJx7U6uz0x8i6Hf6 X-Gm-Message-State: AOJu0YydHyjxKovEyMOCfoW/aFi07mVekjJ/03nSmyVadfhTreSkxL2i FTQsp5AXl8v13WwuGI0SMjed9migpGjK2K9RHv1SnNVyUrxOrZZfRKurENiWSXtxDgJoxtXJkm1 y1zjt50Am9A6HmeHaTOaSE//+w+I= X-Google-Smtp-Source: AGHT+IEUgTkkM/vf91wiaXy61IHPPnJ+EHnwWweDxA2UQ1aA3A4XC+r9uToU3kOPNrvXN+dXkOyxKysRzRWqaEDYOM8= X-Received: by 2002:a17:906:80c5:b0:a3f:2259:da62 with SMTP id a5-20020a17090680c500b00a3f2259da62mr1769860ejx.52.1708515420359; Wed, 21 Feb 2024 03:37:00 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Michail Nikolaev Date: Wed, 21 Feb 2024 12:36:48 +0100 Message-ID: Subject: Re: Revisiting {CREATE INDEX, REINDEX} CONCURRENTLY improvements To: Matthias van de Meent Cc: Melanie Plageman , PostgreSQL Hackers , Alvaro Herrera Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi! > How do you suppose this would work differently from a long-lived > normal snapshot, which is how it works right now? Difference in the ability to take new visibility snapshot periodically during the second phase with rechecking visibility of tuple according to the "reference" snapshot (which is taken only once like now). It is the approach from (1) but with a workaround for the issues caused by heap_page_prune_opt. > Would it be exclusively for that relation? Yes, only for that affected relation. Other relations are unaffected. > How would this be integrated with e.g. heap_page_prune_opt? Probably by some flag in RelationData, but not sure here yet. If the idea looks sane, I could try to extend my POC - it should be not too hard, likely (I already have tests to make sure it is correct). (1): https://www.postgresql.org/message-id/flat/CANtu0oijWPRGRpaRR_OvT2R5YALzscvcOTFh-%3DuZKUpNJmuZtw%40mail.gmail.com#8141eb2ea177ff560ee713b3f20de404