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 1vgIcJ-00Abnk-1s for pgsql-hackers@arkaria.postgresql.org; Thu, 15 Jan 2026 08:22:08 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vgIcI-00FgXB-2R for pgsql-hackers@arkaria.postgresql.org; Thu, 15 Jan 2026 08:22:06 +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 1vgIcI-00FgX2-1V for pgsql-hackers@lists.postgresql.org; Thu, 15 Jan 2026 08:22:06 +0000 Received: from mail-qt1-x829.google.com ([2607:f8b0:4864:20::829]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vgIcG-000aDj-0i for pgsql-hackers@postgresql.org; Thu, 15 Jan 2026 08:22:06 +0000 Received: by mail-qt1-x829.google.com with SMTP id d75a77b69052e-4ee1939e70bso7345211cf.3 for ; Thu, 15 Jan 2026 00:22:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1768465322; x=1769070122; darn=postgresql.org; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=+KroEohNA+U8fPtzB71udnxNmYjZvucGU79NBD+1txI=; b=SaEzRS8TDFmxBSndbddVADRde1N9OQNWX7SkB2vSue4YQKFjFkWDeLHaUlEhODUnz5 cfRVuRqUjpLzDAyOzUwf9yoOJvAae9KjX+I3AlP5iIr5eJMHrHhzL6NZptBzoqSV+dT1 KLNIYRw1P+I3vWvm4wrTEKSv5mKSyWIvFR+CajsGTZsSV0aLEQlj9x3bdO3QH99Elnk1 ilzEuh6p61XtfukDa4x+RK82DwPXSalr0neeiU8PTG6G99+QIPqpYn9zZyn25JtXooFy XQKab+Hr5T54ERpUSkx97YxZliIvueDrnBVLrxbahTIkW3GtCNXSe8/v0Qr6W160DVpJ 5HRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768465322; x=1769070122; h=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=+KroEohNA+U8fPtzB71udnxNmYjZvucGU79NBD+1txI=; b=gr/HmtfqCFWTwR9hFh8G5qIXMOULQdlmCEjGvWc3MPIBprPz8xeGP2sPyunnKhRIul FpcXlVBDFp6u95LebQWsr8ES0Q1ZxQPrv54djdTVNOi0lNrRxELix7YvTuo/dK/9yb3J jDum9ysUsE+4GS2UEvnTYMXl/P4EAwV/GVqQqKSNNBREBFdrj8hQL8JnZo42pyYjlafQ 5Ny4n1US0bJ8V3GMTyQwI2HJMdFiPBPu+/GW1zyHM4Gib74ovCaEMAh2kfFfpJmpwSo1 09gNjxip4FSNoUlmhJtwZUe1XCOVF2YikzwRzD0Dh2xXxoRyNAN3N20Dr9AWgbhYKe6l xjkQ== X-Gm-Message-State: AOJu0Yw/AJsmh7faub64kk2RPFxIbqgGmK4a7b3bSgPuIbes+AWKzcGs ugGbIqK1PHfV4t9eNa6wnuOi/s6jFBVRiFsI6LI9tphjyvvQMtuzjnaY5E5GBmYu4G3elH9fq7a rpitcXimdrzchixpi8Hgs4oL4l9Tk9Lny1WkFlso= X-Gm-Gg: AY/fxX5PVriaF7N7D34GAwnVNFbUwpn9zD4dMsWlgy2mYvww3Mw7raeEdqysqBzYMLS ctGmgjdoLvfK0gx1YYMBIafT7tecX6puINjLicL6Ru/AhNKNCk6eKljiZoXvNsJak/D4Zqo6H2r 94RUH/4Ls2XTLzPcKcrCYFu2mKyT7VFq8bqjpp1BsHLSXkLkYhJHS/MOWj2u9dNdesl2lLmhpcM Yv+tey9VAAq1XL4PWUHNHD7BgLa0ita6laY/EsBuajCOIZrPyZbcleY812IL9NKJh9ZHm3nLq2C CcnN1Wv5Lwk3BNGN1ZqzjcB1wZHJK9EqOGZ9T6ZFSlNq4k7C9yUV1Pb1N39Ly6vktbqJNQ== X-Received: by 2002:ac8:570f:0:b0:4ee:173e:c73 with SMTP id d75a77b69052e-5014a96719dmr69149361cf.60.1768465322166; Thu, 15 Jan 2026 00:22:02 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Kirill Reshke Date: Thu, 15 Jan 2026 13:21:51 +0500 X-Gm-Features: AZwV_QgngAACzPNNqf-dQDPtJEYqEcqJsjSrzJ_p6kMwlmr2A0Q43_LkWgRWVpc Message-ID: Subject: Re: Fix gistkillitems & add regression test to microvacuum To: pgsql-hackers Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, 15 Jan 2026 at 12:46, Kirill Reshke wrote: > > On Thu, 15 Jan 2026 at 12:00, Kirill Reshke wrote: > > > > Hi hackers. > > > > While looking at [0] I noticed that XLOG_GIST_DELETE & XLOG_GIST_PAGE_DELETE > > records are not covered. > > > > This thread addresses XLOG_GIST_DELETE, which is also known as a > > microvacuum feature. > > > > test.sql contains regression test that trigger this code to be > > exercised in stream_regress.pl TAP test. > > > > Test is as follows: we create a gist index on the table, then we > > insert exactly 407 records, making the root page full (next insert > > will trigger page split). Then I delete all tuples from relation and > > trigger Index Only scan to do kill-on-select (killtuples). It marks > > gist 0 page (which is root and is leaf) as has_garbage. Then, the next > > insertion triggers xlog_gist_delete record. > > > > To verify this I use pageinspect and pg_waldimp (locally). Also this > > test is dependent on block size being 8192 which is not good. > > > > > > And all of this does not work actually without v1-0001, because there > > is a bug in GiST which does not call gistkillitmes for the very first > > (root) page. > > > > There is also test2.sql which inserts a single tuple, not 407. It can > > be used to verify v1-0001. > > > > [0] coverage.postgresql.org/src/backend/access/gist/gistxlog.c.gcov.html > > > > > > -- > > Best regards, > > Kirill Reshke > > > From cf feedback it turns out we already have an isolation test for > this, and it does almost exactly the same. > And more, it fails. > Will try to fix > > > -- > Best regards, > Kirill Reshke This looks like gist does not work for small indexes and this is explicitly tested after [0] [0] https://www.postgresql.org/message-id/lxzj26ga6ippdeunz6kuncectr5gfuugmm2ry22qu6hcx6oid6%40lzx3sjsqhmt6 -- Best regards, Kirill Reshke