Re: B-Tree support function number 3 (strxfrm() optimization) - Mailing list pgsql-hackers

From Andrew Gierth
Subject Re: B-Tree support function number 3 (strxfrm() optimization)
Date
Msg-id 87h9vklbgp.fsf@news-spur.riddles.org.uk
Whole thread Raw
In response to Re: B-Tree support function number 3 (strxfrm() optimization)  (Peter Geoghegan <pg@heroku.com>)
List pgsql-hackers
>>>>> "Peter" == Peter Geoghegan <pg@heroku.com> writes:
Peter> You'll probably prefer the attached. This patch works byPeter> disabling abbreviation, but only after writing
outruns, withPeter> the final merge left to go. That way, it doesn't matter whenPeter> abbreviated keys are not read
backfrom disk (or regenerated).
 

This seems tolerable to me for a quick fix. The merits of storing the
abbreviation vs. re-abbreviating on input can be studied later.
Peter> I believe this bug was missed because it only occurs when therePeter> are multiple runs, and not in the common
casewhere there is onePeter> big initial run that is found already sorted when we reachPeter> mergeruns().
 

Ah, yes, there is an optimization for the one-run case which bypasses
all further comparisons, hiding the problem.

-- 
Andrew (irc:RhodiumToad)



pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: Error check always bypassed in tablefunc.c
Next
From: Heikki Linnakangas
Date:
Subject: Re: Dereferenced pointers checked as NULL in btree_utils_var.c