Re: B-Tree support function number 3 (strxfrm() optimization)

From: Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk>
To: Peter Geoghegan <pg(at)heroku(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>, Noah Misch <noah(at)leadboat(dot)com>, Marti Raudsepp <marti(at)juffo(dot)org>, Stephen Frost <sfrost(at)snowman(dot)net>, Greg Stark <stark(at)mit(dot)edu>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: B-Tree support function number 3 (strxfrm() optimization)
Date: 2015-01-21 09:47:54
Message-ID: 87h9vklbgp.fsf@news-spur.riddles.org.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

>>>>> "Peter" == Peter Geoghegan <pg(at)heroku(dot)com> writes:

Peter> You'll probably prefer the attached. This patch works by
Peter> disabling abbreviation, but only after writing out runs, with
Peter> the final merge left to go. That way, it doesn't matter when
Peter> abbreviated keys are not read back from 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 there
Peter> are multiple runs, and not in the common case where there is one
Peter> big initial run that is found already sorted when we reach
Peter> mergeruns().

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

--
Andrew (irc:RhodiumToad)

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2015-01-21 10:07:53 Re: Dereferenced pointers checked as NULL in btree_utils_var.c
Previous Message Michael Paquier 2015-01-21 08:32:14 Re: Error check always bypassed in tablefunc.c