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

From Robert Haas
Subject Re: B-Tree support function number 3 (strxfrm() optimization)
Date
Msg-id CA+TgmoYtMrpED4ckyxiCV2ZAA5iwENX2HL4cDXNvazPCy_Qw5w@mail.gmail.com
Whole thread Raw
In response to Re: B-Tree support function number 3 (strxfrm() optimization)  (Peter Geoghegan <pg@heroku.com>)
Responses Re: B-Tree support function number 3 (strxfrm() optimization)
List pgsql-hackers
On Fri, Aug 22, 2014 at 2:46 PM, Peter Geoghegan <pg@heroku.com> wrote:
> On Fri, Aug 22, 2014 at 7:19 AM, Robert Haas <robertmhaas@gmail.com> wrote:
>> Patch 0002 no longer applies; please rebase.
>
> I attach rebased patch.
>
> Note that there is currently a bug in the master branch:
>
> +   if (len2 >= tss->buflen2)
> +   {
> +       pfree(tss->buf2);
> +       tss->buflen1 = Max(len2 + 1, Min(tss->buflen2 * 2, MaxAllocSize));
> +       tss->buf2 = MemoryContextAlloc(ssup->ssup_cxt, tss->buflen2);
> +   }

You didn't say what the bug is; after inspection, I believe it's that
line 4 begins with tss->buflen1 rather than tss->buflen2.

I have committed a fix for that problem.  Let me know if I missed
something else.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



pgsql-hackers by date:

Previous
From: Fabien COELHO
Date:
Subject: Re: postgresql latency & bgwriter not doing its job
Next
From: Greg Stark
Date:
Subject: Re: Proposal for CSN based snapshots