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 1u95Sh-00FE6h-R2 for pgsql-committers@arkaria.postgresql.org; Sun, 27 Apr 2025 17:06:40 +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 1u95Sf-009may-KP for pgsql-committers@arkaria.postgresql.org; Sun, 27 Apr 2025 17:06:38 +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 1u95Sf-009maq-Bo for pgsql-committers@lists.postgresql.org; Sun, 27 Apr 2025 17:06:38 +0000 Received: from mail-oo1-xc2b.google.com ([2607:f8b0:4864:20::c2b]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1u95Sc-002F57-0M for pgsql-committers@lists.postgresql.org; Sun, 27 Apr 2025 17:06:35 +0000 Received: by mail-oo1-xc2b.google.com with SMTP id 006d021491bc7-6062e41916dso2393195eaf.1 for ; Sun, 27 Apr 2025 10:06:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb.com; s=google; t=1745773593; x=1746378393; darn=lists.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=xAlW0lfggJSN9lGqaTVNKq5U5220XnbBpDpLAlvM1Ac=; b=UZohvVY5aztYXlbKnedDS3sVmq+ov/er7iUWAtGx9/Y/fEp+J3bwFP0Mc2vghNwObG cB4uy0wjCwj6ecCD6Xn6QNfJeTmRimbxyvUYT0RW5xL6/vVVsQWMQ25uOxpWNPJ1zgCt t9BLgX66Uo1HZOsvKJi5vX2SPOYIwG74P2M4KKL40dUCXAYr3MrEj/ohed+jnnUyMXiB UwVDggakGMS6Q4q3Uc54lWckLoKcfJw6ALGw63w8wOr9TVWC9ZsmhhNO+7Jalw9f/GhP ELjikMPcdXqV7X+7XeR2qyZ6ipu5GvTRao16BpEFiD0H/qcfFaUwgDT3bfIJ/wwZJ+MZ SObA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745773593; x=1746378393; 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=xAlW0lfggJSN9lGqaTVNKq5U5220XnbBpDpLAlvM1Ac=; b=hB8BYiHvfX3dZlcBD6fadAOS4iZtzbBN/OCgFgr1C7niwjTS4mnb2gwoy+hnIsNY+G x+I80R5HGgrhQi2Jq2rqhIoHQJmbZog8I8HgomtIuVWkYzm3ZJivNXCCDMi7QhtqOHNr HQch1pMMMn3o5MaOV3kucWgTzclGIUzeSWKkvuvgSu87y6nU6v4W3RrsPT0aoAtUslIY wTThIoPlF1j/tsvbugFE7Wpjk+A/SqXdJpjiJq1Z9USFtMslBBhHzJrLuhQKkhpMlejq KEL2PuxODtbYJvfMBTii3xifvIu0bTKP++eaTABkP8S0gqMC8QtxMyjZFcsgN1ZJzwqr +5LA== X-Forwarded-Encrypted: i=1; AJvYcCV4jK8qKnfxNDhVMdzG5pXusXyjc3AUyQtCpyZyKe+bSNjioEpC4lkFs00MxhX0ziu3mmxV1q9R1npfqq4a454i@lists.postgresql.org X-Gm-Message-State: AOJu0Yw/sAmmMWHB0e5pgg5wfv2j6en1IYBdVv6QhiJHeWWyAWoE631y H8ermqJmU7N3KND3W93OL/SZtWXLMneE5mMDrrWZUnf4X6LBsy3nvVPgUpi6L8u8LkgMxl2c6ke m/cCoamln61rJM3YrgRckcfSzlVYVV5yJZ4J1 X-Gm-Gg: ASbGncu0pREAA9VZF6EO7RjLu+jieAM0WNbEn+KY7m9SbJHdzV7vhznSEHMqP17/oAl ioiHrGqj/+z5Hzy2s2uOZk4gigSw30uDCI+8/1tHB/bEecZripMe3wfOJhKBwhoz4LVdacsck+/ gKw5l9Ch1PRdjlV3TPHqHVSQ== X-Google-Smtp-Source: AGHT+IHtRNPRUsyvhimCkvYEMWPjE1qBM6vc2lWwDahEMDYxEoeFvoMdY/rs8OSQws011ijJNDBf3hO2+3eIxjD8mto= X-Received: by 2002:a05:6820:2005:b0:604:db:d10b with SMTP id 006d021491bc7-60658f1e030mr4149164eaf.3.1745773593664; Sun, 27 Apr 2025 10:06:33 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Mark Dilger Date: Sun, 27 Apr 2025 10:06:22 -0700 X-Gm-Features: ATxdqUE36BT_DctyNaoRLTEhyxsbeuq8uSZj4MJBz5vdubMzZIBcVbUF9Ooa57o Message-ID: Subject: Re: pgsql: Improve nbtree skip scan primitive scan scheduling. To: Peter Geoghegan Cc: Matthias van de Meent , pgsql-committers@lists.postgresql.org Content-Type: multipart/alternative; boundary="000000000000e8b9ea0633c59601" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000e8b9ea0633c59601 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sat, Apr 26, 2025 at 8:53=E2=80=AFPM Peter Geoghegan wrote: > On Sat, Apr 26, 2025 at 10:39=E2=80=AFPM Mark Dilger > wrote: > > Peter, Matthias, thanks kindly for the good work on skipscans! > > Thanks! > > > I found a test case which fails after commit > 21a152b37f36c9563d1b0b058fe1436baf578b4c. Please find a reproducible tes= t > case, attached. > > The bug isn't actually in commit > 21a152b37f36c9563d1b0b058fe1436baf578b4c -- it's just an accident that > the mechanism added by that commit happens to make your test case > fail. The underlying issue was introduced in commit 8a510275, "Further > optimize nbtree search scan key comparisons". > > This looks to have been a silly oversight in our handling of NULL > tuple datums within _bt_check_compare. Attached provisional fix makes > your test case pass. > > -- > Peter Geoghegan > I can confirm that your patch fixes the problem, having spent some four hours trying to find other test cases which still fail, finding none. Thank you for the quick reply, and again for the work on btree. --=20 =E2=80=94 Mark Dilger EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company --000000000000e8b9ea0633c59601 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Sat, Apr 26,= 2025 at 8:53=E2=80=AFPM Peter Geoghegan <= pg@bowt.ie> wrote:
On Sat, Apr 26, 2025 a= t 10:39=E2=80=AFPM Mark Dilger
<mark.= dilger@enterprisedb.com> wrote:
> Peter, Matthias, thanks kindly for the good work on skipscans!

Thanks!

> I found a test case which fails after commit 21a152b37f36c9563d1b0b058= fe1436baf578b4c.=C2=A0 Please find a reproducible test case, attached.

The bug isn't actually in commit
21a152b37f36c9563d1b0b058fe1436baf578b4c -- it's just an accident that<= br> the mechanism added by that commit happens to make your test case
fail. The underlying issue was introduced in commit 8a510275, "Further=
optimize nbtree search scan key comparisons".

This looks to have been a silly oversight in our handling of NULL
tuple datums within _bt_check_compare. Attached provisional fix makes
your test case pass.

--
Peter Geoghegan

I can confirm that you= r patch fixes the problem, having spent some four hours trying to find othe= r test cases which still fail, finding none.

Thank= you for the quick reply, and again for the work on btree.

--
=E2=80=94
Mark Dilger
EnterpriseDB:=C2=A0http://www.enterprisedb.comThe Enterprise= PostgreSQL Company
--000000000000e8b9ea0633c59601--