Re: [PATCH] Improve amcheck to also check UNIQUE constraint in btree index.

From: Alexander Korotkov <aekorotkov(at)gmail(dot)com>
To: Noah Misch <noah(at)leadboat(dot)com>
Cc: Pavel Borisov <pashkin(dot)elfe(at)gmail(dot)com>, Peter Eisentraut <peter(at)eisentraut(dot)org>, Aleksander Alekseev <aleksander(at)timescale(dot)com>, Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Maxim Orlov <orlovmg(at)gmail(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, Greg Stark <stark(at)mit(dot)edu>, Julien Rouhaud <rjuju123(at)gmail(dot)com>, Mark Dilger <mark(dot)dilger(at)enterprisedb(dot)com>, David Steele <david(at)pgmasters(dot)net>, Peter Geoghegan <pg(at)bowt(dot)ie>, Maxim Orlov <m(dot)orlov(at)postgrespro(dot)ru>, lubennikovaav(at)gmail(dot)com
Subject: Re: [PATCH] Improve amcheck to also check UNIQUE constraint in btree index.
Date: 2024-05-10 00:11:41
Message-ID: CAPpHfdvxK+KSDqopaVdmCHgbO92AN4ibrbiCJ6i6-+g4oma-6Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, May 1, 2024 at 5:26 AM Alexander Korotkov <aekorotkov(at)gmail(dot)com> wrote:
> On Wed, May 1, 2024 at 5:24 AM Noah Misch <noah(at)leadboat(dot)com> wrote:
> > On Thu, Apr 25, 2024 at 04:59:54PM +0400, Pavel Borisov wrote:
> > > 0001: Optimize speed by avoiding heap visibility checking for different
> > > non-deduplicated index tuples as proposed by Noah Misch
> > >
> > > Speed measurements on my laptop using the exact method recommended by Noah
> > > upthread:
> > > Current master branch: checkunique off: 144s, checkunique on: 419s
> > > With patch 0001: checkunique off: 141s, checkunique on: 171s
> >
> > Where is the CPU time going to make it still be 21% slower w/ checkunique on?
> > It's a great improvement vs. current master, but I don't have an obvious
> > explanation for the remaining +21%.
>
> I think there is at least extra index tuples comparison.

The revised patchset is attached. I applied cosmetical changes. I'm
going to push it if no objections.

I don't post the patch with rename of new option. It doesn't seem
there is a consensus. I must admit that keeping all the options in
the same naming convention makes sense.

------
Regards,
Alexander Korotkov
Supabase

Attachment Content-Type Size
v2-0003-Amcheck-Don-t-load-rightpage-into-BtreeCheckState.patch application/octet-stream 1.9 KB
v2-0002-amcheck-Refactoring-the-storage-of-the-last-visib.patch application/octet-stream 11.0 KB
v2-0001-amcheck-Optimize-speed-of-checking-for-unique-con.patch application/octet-stream 3.8 KB
v2-0004-amcheck-Report-an-error-when-the-next-page-to-a-l.patch application/octet-stream 2.5 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2024-05-10 00:42:55 Re: [PATCH] Improve amcheck to also check UNIQUE constraint in btree index.
Previous Message Bruce Momjian 2024-05-09 23:54:22 Re: First draft of PG 17 release notes