Re: sortsupport for text

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Peter Geoghegan <peter(at)2ndquadrant(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: sortsupport for text
Date: 2012-07-23 15:36:56
Message-ID: CA+TgmoZ0GC5OoEaatcTiNYOuA2E1qfp22SiK1qXkzr+zDTuZvg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Jul 23, 2012 at 11:34 AM, Peter Geoghegan <peter(at)2ndquadrant(dot)com> wrote:
> On 23 July 2012 16:09, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
>> However, what this really boils down to is that you and Peter don't
>> like this line of code:
>>
>> + tss->buflen1 = TYPEALIGN(TEXTBUFLEN, len1);
>
> I can only speak for myself, though I agree with your summary here.
>
>> What would you like it to say instead?
>>
>> The obvious formulation is:
>>
>> while (len1 < tss->buflen1)
>> tss->buflen *= 2;
>
> That's what I had in mind. +1.
>
>> Or perhaps the following, which will normally be more efficient,
>> though possibly not as efficient as what I've got there now:
>>
>> tss->buflen = 1 << ffs(len1);
>
> I'm sorry, I don't follow you here. What is ffs() ?

Sorry, fls, not ffs. I always get those mixed up.

See src/port/fls.c

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2012-07-23 16:07:18 Re: sortsupport for text
Previous Message Peter Geoghegan 2012-07-23 15:34:29 Re: sortsupport for text