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 1vviWJ-00Fder-0O for pgsql-hackers@arkaria.postgresql.org; Thu, 26 Feb 2026 21:03:39 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vviWI-00FYfq-08 for pgsql-hackers@arkaria.postgresql.org; Thu, 26 Feb 2026 21:03:38 +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 1vviWH-00FYfZ-2N for pgsql-hackers@lists.postgresql.org; Thu, 26 Feb 2026 21:03:37 +0000 Received: from mail-ed1-x529.google.com ([2a00:1450:4864:20::529]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1vviWD-00000001SLP-49Li for pgsql-hackers@postgresql.org; Thu, 26 Feb 2026 21:03:36 +0000 Received: by mail-ed1-x529.google.com with SMTP id 4fb4d7f45d1cf-65f812e0c83so2496619a12.2 for ; Thu, 26 Feb 2026 13:03:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1772139814; cv=none; d=google.com; s=arc-20240605; b=NiYLU2YKa5e0i4lGI8cVulZAQ/7tNqfbSDRk2KvSxPkTAKS5SuoHr7cQt3/ZtdatFA 336My0jXKHPI1FSeKIoZJ/4AYTpjx8bZr3EjSrtX3Y6AmooKRrowr0AVvq2czikCOE7p 1a82gSKTiT/b1JngTrenBLdaB3ksX28GKz7pw9cYn+E8/hr+hk29x69Mx4AmCf/eez4/ 5Cux6+tBW6PdZwNpzed49XCiA/HGYl/tadRaYZBH1OITRClrWvVUszfddbmXwZF/7PaU mePYkoGb7mrNV5wIDBxBkC4TFFI9qg82KbJ9oxBP0dMurfns1cpJNgL4yxW/eXO8iJUp XNjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=74+7AO9yoekTAtmkjg/h7Isr7Sa7piSnen3xtgo+Vfk=; fh=J09Sr/TuYmw3Qb2N8DuzE5QF7czZQZ5DfwF6+65OhKU=; b=Mr3/oPWyWd/PxKZ242+TkMAcrrZ73ra2w7JGBTBoLeC/0GCMWLKwslsp95+rnDXv6U dJh3sP4qTjsnP8aiC5gZ+5S/Y7bvPjKkFcTe6BRnYzdk1VM6aXbkeJ1/imOY4GfGBd0S pc72aeO5Fm5WjXEGTCFQL03WfN6llrvv9XZ+DCLRm8g6DBSQpc3K1fSmz3b3bhjKSFmr nt5ycEUGL5tWb2Odms+Ta4eli6ny6bv3MvdtLBqUgfZm8IFgbPuRp9g+Mud8nolI2K6l rbMKb7iboMk6qpmsibKv4+6HQ27qovcJWKAUqWpkFubvh8XiW2prNRucxoal/dRCJ/wr VjXw==; darn=postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1772139814; x=1772744614; 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=74+7AO9yoekTAtmkjg/h7Isr7Sa7piSnen3xtgo+Vfk=; b=FCLrxhMtCTGT54ExNt+a4h3odT2loPNdqKNTAWVzx+qEGaAodoHnsjhHw2AiIuUNFG Ic1ApEFg+TND4Nvc1FY09wJHocjaJBjWPUU0sqi57WoCPNiDVPoLPhAACUX/YDfOe++w SCB+iBOjLnDfAMrN6Tw71SHezQwo9Ngyeyj3Qcg4PFthhiriq32l1lbCtV+rjtXvzdXa ueNtSozSBIdHX98U9Ktp942TYPFSw/vUF957RMBAg+e58hTgnCa8R+z7eHzSZWlNd7mx JfuR9hX+L7HMMTblaXZH17GRt+RQw219nJF0kVaJdsmMSd/CG3FJ1B5wD/99XieLght4 7dRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772139814; x=1772744614; 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=74+7AO9yoekTAtmkjg/h7Isr7Sa7piSnen3xtgo+Vfk=; b=rApi8HUmvWnCfBOj4WeIXGBr6OgD9HfKlC0jwvs6mw3edl/2BDrlbFepnEMpaVBfd1 qTmACx1N0Nw2gMwx/V3Nz6+kHJqqSCe0M1SAmjwOrbHTWWafxpIxLIncyeiPwE3hHB8r FcF5GedOSmtwBlo5sGzOqRk9SUxgNQDIa+lhnF/e/8JMAGqCfjVc/WIj7U2XoZynAqzn MF/5FMJHNeeZ3haPUlMjKzqpHXBGg6vxrrO1uA8yUH58wVB/oWkHgVb+O7DbbEagZwW8 cOL9yvuhX9d/OPMaYT9+iOQkDLkGHNPw4lvfI+buoQ7PbIJTyy+Hj91FZcTVWIEgkbTh 4iTw== X-Forwarded-Encrypted: i=1; AJvYcCXAk2MAaYaAKaqPuKBmK+PaP8XN4Lejru1WxuoGiR+EL38LDMwTJ5F590Wy9yorcCnElxXGam3ZZnMmdnnP@postgresql.org X-Gm-Message-State: AOJu0Yxc1g7sEghslb9tPRvAr81t6cFxVZmZMP4QApqaZ9S9EJIFBC9W U1s7bhyTmlXuAtxFK4mymIt4KbNcNUDcvs7IPLFQ+8PcnR+Lqhot1xgjTIYUnTrSQD0sdLXSDnb o40Bw7Lfcfg11yEko/673sWoRfaetSwY= X-Gm-Gg: ATEYQzzLl6U9KI/AR7BiZvGQfbP1YaPYHqsoZMkzxK80NktAsGwuGTyxWU9JHgNV6Xu 1/dDwD+fINCAZ3lxH4NAygdr0bqwJMve01XZdp1Pus10wglt+uAc/QfC1s7n4SD3wPrWg740Iln 7oh/4N+q7tyiXG/rjq3zKDkHLdOJ64cnASAWmXoiJKT2t9h8ADCiz/8HR0tvboZLM/a5U9HmLRP biRJSAMiqt69tYGxBSDHq+hAuTBSZMJQB+7eP1rho090Cli2kVEYyvD8zhpP95jBalnMgZZsE99 P4n1PSca8TpcH7R3fq77xzPnJ/D80VRX4fnRlQ== X-Received: by 2002:a17:907:3d4b:b0:b91:2f65:e938 with SMTP id a640c23a62f3a-b93765c75e4mr15722966b.60.1772139813526; Thu, 26 Feb 2026 13:03:33 -0800 (PST) MIME-Version: 1.0 References: <11A59C0C-A8C8-4642-8493-292D5DF8311D@yandex-team.ru> In-Reply-To: From: Madhav Madhusoodanan Date: Fri, 27 Feb 2026 02:33:22 +0530 X-Gm-Features: AaiRm50arkE4OThvNAOt81-CmVlyvIUCYkJ4RNwWEcQzIkKaItRg0uvKOwCtGFo Message-ID: Subject: Re: [WiP] B-tree page merge during vacuum to reduce index bloat To: Kirk Wolak Cc: Matthias van de Meent , Andrey Borodin , pgsql-hackers , Nikolay Samokhvalov 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 Tue, Aug 26, 2025 at 2:11=E2=80=AFPM Kirk Wolak wrote= : > I do have a question, one of the IDEAS we discussed was to ADD a new page= that combined the 2 pages. Would the flow then be as follows? Please correct me if I'm wrong: Start: Parent page P, with adjacent child pages A -> B -> C -> D. Pages B and C are sparse enough and are about to be merged. 1: Acquire lock on pages B and C 2: Create a new page N, which copies the tuples in pages B and C 3: Acquire lock on parent page P, update the separator keys in P, release lock on P 4: Update pointers such that pages link like so: A -> N -> D 5: Release lock on pages B and C Regards, Madhav