Re: optimize lookups in snapshot [sub]xip arrays - Mailing list pgsql-hackers

From Nathan Bossart
Subject Re: optimize lookups in snapshot [sub]xip arrays
Date
Msg-id 20220809200037.GA1490626@nathanxps13
Whole thread Raw
In response to Re: optimize lookups in snapshot [sub]xip arrays  (John Naylor <john.naylor@enterprisedb.com>)
Responses Re: optimize lookups in snapshot [sub]xip arrays
Re: optimize lookups in snapshot [sub]xip arrays
List pgsql-hackers
On Tue, Aug 09, 2022 at 01:21:41PM +0700, John Naylor wrote:
> I decided I wasn't quite comfortable changing snapshot handling
> without further guarantees.  To this end, 0002 in the attached v11 is
> an addendum that adds assert checking (also pgindent and some
> comment-smithing). As I suspected, make check-world passes even with
> purposefully screwed-up coding. 0003 uses pg_lfind32 in syscache.c and
> I verified that sticking in the wrong answer will lead to a crash in
> assert-enabled builds in short order. I'd kind of like to throw this
> (or something else suitable) at the build farm first for that reason.
> It's simpler than the qsort/qunique/binary search that was there
> before, so that's nice, but I've not tried to test performance.

Your adjustments in 0002 seem reasonable to me.  I think it makes sense to
ensure there is test coverage for pg_lfind32(), but I don't know if that
syscache code is the right choice.  For non-USE_SSE2 builds, it might make
these lookups more expensive.  I'll look around to see if there are any
other suitable candidates.

-- 
Nathan Bossart
Amazon Web Services: https://aws.amazon.com



pgsql-hackers by date:

Previous
From: "Jonathan S. Katz"
Date:
Subject: Re: PG 15 (and to a smaller degree 14) regression due to ExprEvalStep size
Next
From: Andrew Dunstan
Date:
Subject: Re: PG 15 (and to a smaller degree 14) regression due to ExprEvalStep size