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 1vgIpY-00Aeuk-2l for pgsql-hackers@arkaria.postgresql.org; Thu, 15 Jan 2026 08:35:49 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vgIpX-00Fkow-07 for pgsql-hackers@arkaria.postgresql.org; Thu, 15 Jan 2026 08:35:47 +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 1vgIpW-00Fkoo-2B for pgsql-hackers@lists.postgresql.org; Thu, 15 Jan 2026 08:35:46 +0000 Received: from mail-qk1-x732.google.com ([2607:f8b0:4864:20::732]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vgIpU-000aJh-1f for pgsql-hackers@postgresql.org; Thu, 15 Jan 2026 08:35:46 +0000 Received: by mail-qk1-x732.google.com with SMTP id af79cd13be357-8b31a665ba5so85689585a.2 for ; Thu, 15 Jan 2026 00:35:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1768466142; cv=none; d=google.com; s=arc-20240605; b=ach9NPdDx+2Yf86ppPrOT3j/FsKvduJ7CM8ws8NeIEnE5j84DgLQ6aJlwymHGouTVE 8U7j5g75GuLMPhrDsYDLETgju70aUtTM/QsjQaxEYXW9VwHJUvxX02cC1zrTNVdgzWJD x2kYWiokIQNmHUFZT+5rN1kZEC+HmBBQinr9m+Ld8UJMXv4q/Ex/rVTzHsRCI2epZQiF kSUkUVFxA9s898/oxZQqU5ekyOHMvBwmmVZRD5XK19xpP+/hUEstORbEiSsNHM+vPf3/ M6N9XUZPkwkMvJgDSvOmR9fgRSbRKnYlUdZQjPMS1s3r6vM04R0IscarW3QIh8vA2YbT kikw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=/JzqtmeSCDcLTSCBR0AxzFYC8pw7djFRq37yx9Skvvk=; fh=RfrkJab44jNT7RraF/sJO97r9/nkUL0AAgzmC7PBS2w=; b=RE3NeOnZzyuVDjPtzE5xMU0yU6pDc6IIhyP6SnLldjVfhRmdDKk4F84lZxenWaOa/T nuhdYQImES0wscBLRlN88uGxBG4/xoEj9OKmaFcECwmxG+AIFXCY5ofLo9b8YbpeFdMe j5gWqEqX2/UqGNh8zdnscc/+Nz4eU+7SwT7GrTR/sMR7XW9g/vWJt5ckus6klmFgPB3m rNfWVRCZxskbbvymy6XD3TGjtL87FTx//USnqg7ty1ltmA0Lk9XYAAtzMKD8xrNYFv+1 aqsNu5wQl12g9KYauVvahrb6LZhSKZ87CeKkYecc+JNyqYug/rM//yXiu7Uqad+eDijj vSsQ==; 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=1768466142; x=1769070942; 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=/JzqtmeSCDcLTSCBR0AxzFYC8pw7djFRq37yx9Skvvk=; b=Y41oe2DyT3eotyEHKPUxW/UKbhKHx88ucs+18cRbcl3r11PfY6dy/e+WhObsIbovf1 Lz/7NOOhmblnH87yp1ROXs3/i83EH3rgzzR0jEGdGYo9V8+3Nqid5V16LFZIwpP6brBA pcby5qaS9RfkumeZaDC8jt9lgZMR+YiENCZiq9JMyzCfG659IgFvSUJQ78E1id6ZptOz 1AyzjXccTxgSAdMsoT+wr02oX9aO6+gBVNVeNM3Rip2tplp9Drt4ZciQkxwZVjD+P6W4 DOpMPb9eFDDygZa4NauClfk81PM01K+afLnAg1Y5tD3ycLEPGIw+FWLcx3pCWgBZcVKW 1Nng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768466142; x=1769070942; 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=/JzqtmeSCDcLTSCBR0AxzFYC8pw7djFRq37yx9Skvvk=; b=LiBw7iKzBKy8L0prjQ8btZ70Oby/VNnrNXH4m2woxyzvUlET8lmkm+RK7NMFoGExf0 b6IMr60pzDaBJA7lA+sRI/aQkFY9INWspHFwPW+VwX5ASffmFNo4BYIvgTsHlcCBFxhh wA+hSOAyj/V2pd+YUyqEobXQTITrcw5CfFKcdhDmEUIQjFxOPzKK6rl1cW+ia9O9bJgn 2uFoEQydBfXfmk2xV+R3CJhB2QdlwmjRkbfFmj4nu2+RpVNdeDxOHoYwY8KcA9D2gjNH X+q6VeWdmI79KSIrRN1CNDtr2BVJBR7rs25H+JhnaUDayg4HPYnAiWXXdU8frO8DxO9S 7WoA== X-Gm-Message-State: AOJu0Yx8E/76lvcSiH1dzsY9FYqMLMDZM02eJxP8rbWZMDyofA/qGzpi so1+goIYCHGsoNR5MSoylP1ZNR7xGRzViCgQ8k6NJnmThoBIaFoZdcyA1WCCh3Kh/pcYFidWfpf AArVuvnKeAD2FplUvEJGjR2mHfpJyad3Jjtw9JYY= X-Gm-Gg: AY/fxX4I+7AUiYme/KUOKkncyCqao6JEypCbaC7KnK/HexW45mJy3Sz4f/c7MRDbdLS KLHvwMsZU0iWJZQkQpwkdiDPuxgyNhDd40eB7fB/ChSzv/RTu83obOR6fzumWhesaebefn7/FvY glG9PuHbGDXQwG//0APC/mo7XGK5Km4IRLpxYhQWbZjb1drLRqrAc39u7/0a/ObEuTodzP8fKQh +HR+bWtJ6z4lGMpe2O1vKvXl0ntodXSz3tcvl+U8jnLqyv8lWazC+mUNvAtiUVg/TPeoMhT1S48 4QaqkfYA30T//lEdgIjpp9muXWfS4S8x/YD1qVdMiScdGC5SW4yDoJDDQqvh0++5bEZZpg== X-Received: by 2002:ac8:5a0e:0:b0:4ee:24fc:bea3 with SMTP id d75a77b69052e-5014823a9fcmr70116941cf.35.1768466142231; Thu, 15 Jan 2026 00:35:42 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Kirill Reshke Date: Thu, 15 Jan 2026 13:35:30 +0500 X-Gm-Features: AZwV_QhYHy2z0GmzA3HxlGk1H1Pl-vwCuKpkR1cKIMbvWopsZPhQb34cn4r75d8 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 13:21, Kirill Reshke wrote: > > 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 I was right on commit message of 377b7ab """ For gist some related paths were reached, but gist's implementation seems to not work if all the dead tuples are on one page (or something like that). The coverage for other index types was rather incidental. """ It does not work if all the dead tuples are on one page and this page is ROOT. So, should we delete this ... # Test gist, but with fewer rows - shows that killitems doesn't work anymore! permutation create_table fill_10 create_ext_btree_gist create_gist flush disable_seq disable_bitmap ... from isolation spec? -- Best regards, Kirill Reshke