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 1rHlha-0048mC-If for pgsql-hackers@arkaria.postgresql.org; Mon, 25 Dec 2023 14:13: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 1rHlhW-002weo-9Y for pgsql-hackers@arkaria.postgresql.org; Mon, 25 Dec 2023 14:13:02 +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 1rHlhV-002wao-SQ for pgsql-hackers@lists.postgresql.org; Mon, 25 Dec 2023 14:13:01 +0000 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rHlhP-00DpOD-8E for pgsql-hackers@postgresql.org; Mon, 25 Dec 2023 14:13:01 +0000 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-40d4e529f24so24840855e9.2 for ; Mon, 25 Dec 2023 06:12:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703513574; x=1704118374; 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=1Vb9/3mrTsz8dN5wRE4rQYYyAXEsWoG7JVzlPmYgtgI=; b=OMMNSeGreKBb7/jnAwLg+ZQxvwOvxfYB/NASpd6jOiUCIHab0gMUdGjuJYcyg74BWs qzc0Z1AgtOamefDeSHTDlj42FTVZbW/L2fWV1a9iIy2ouG6uh1xTkMYkMTIstp0FbSaA DD6bkKB4ehgVHNx2tZFX56TKWI49GM2nVRcfMqMkex5XVTlSqLtZ5X+hhYayYlwgG04+ E7iyIDiLcTA1vPytUbODoes7mcwFqcZT/Nc8ya3+VlxqIhyoypLR5rLGAbg0wCsyIhmE GbSUrOcPukvHwC1rn3ivOuP3gHBxAp7hoWCSoc5IVoj+R0LOUguhF5kcjggkCLJ8TJpg akVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703513574; x=1704118374; 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=1Vb9/3mrTsz8dN5wRE4rQYYyAXEsWoG7JVzlPmYgtgI=; b=JG0nYZwRZ8tcPhU+Hg82V5RDdDYAncqD4Pa2oS0aB/CmJbRzwwQxT6hIkMz3wv/ucl 0v5hOV/DvAFBQzfa0ZogF20xgEbsFIy2gEaqTkKqO16TUMpQVjAI1qdYgqMsnirZDOVN 1jDCaQMHo35xgz18OEHSn3S6rtp8FbViKPDTkLt9lmDDzqGvrGr8A5lW+v6dhVLbZxB1 LkuDOsvBE7dedOemTN024taqkohLfP9sPraJGWKqyyc7GGnUTuLbuxpUN6H0B8OpoIc2 upYRUVZrzN3H6ssBWazXf2bBJTioTmI3B7kCgDb0ODUkOdrfgUG9t7T6k60oNLY49LAj 8P1A== X-Gm-Message-State: AOJu0YyFUPF4qTUZxvIMMTkTPYgKS/xNWUrqrzUYv0B31vIUjetFNcl4 KXf9QV+zWQSg37PdJtm1gNxlVxFg8WR1GoJ9POX4AhZvO/LP6w== X-Google-Smtp-Source: AGHT+IE8vfkr2mc1v1WNMDAN+97raHU78HnXgtmqFHu1foZdR1L/eBO1+h075G/8aNLFmhPM65DhwW5mwZ40kKyfl9M= X-Received: by 2002:a05:600c:4886:b0:40c:3664:aeaa with SMTP id j6-20020a05600c488600b0040c3664aeaamr1969777wmp.148.1703513573514; Mon, 25 Dec 2023 06:12:53 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Michail Nikolaev Date: Mon, 25 Dec 2023 15:12:41 +0100 Message-ID: Subject: Re: Revisiting {CREATE INDEX, REINDEX} CONCURRENTLY improvements To: Matthias van de Meent Cc: 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 Hello! It seems like the idea of "old" snapshot is still a valid one. > Should this deal with any potential XID wraparound, too? As far as I understand in our case, we are not affected by this in any way. Vacuum in our table is not possible because of locking, so, nothing may be frozen (see below). In the case of super long index building, transactional limits will stop new connections using current regular infrastructure because it is based on relation data (but not actual xmin of backends). > How does this behave when the newly inserted tuple's xmin gets frozen? > This would be allowed to happen during heap page pruning, afaik - no > rules that I know of which are against that - but it would create > issues where normal snapshot visibility rules would indicate it > visible to both snapshots regardless of whether it actually was > visible to the older snapshot when that snapshot was created... As I can see, heap_page_prune never freezes any tuples. In the case of regular vacuum, it used this way: call heap_page_prune and then call heap_prepare_freeze_tuple and then heap_freeze_execute_prepared. Merry Christmas, Mikhail.