From: | Sawada Masahiko <sawada(dot)mshk(at)gmail(dot)com> |
---|---|
To: | Heikki Linnakangas <hlinnakangas(at)vmware(dot)com> |
Cc: | PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: fix typo in guc.c |
Date: | 2015-01-26 13:21:33 |
Message-ID: | CAD21AoDKeYN72jdhW2fdaTT2Urxk7cVJKWHb37uRFyPa=6qJvQ@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Mon, Jan 26, 2015 at 10:06 PM, Heikki Linnakangas
<hlinnakangas(at)vmware(dot)com> wrote:
> On 01/26/2015 02:56 PM, Sawada Masahiko wrote:
>>
>> Hi,
>>
>> Attached patch fixes the typo in guc.c.
>> It's typo, I think.
>>
>> diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c
>> index f6df077..f4f1965 100644
>> --- a/src/backend/utils/misc/guc.c
>> +++ b/src/backend/utils/misc/guc.c
>> @@ -3880,7 +3880,7 @@ build_guc_variables(void)
>> }
>>
>> /*
>> - * Create table with 20% slack
>> + * Create table with 25% slack
>> */
>> size_vars = num_vars + num_vars / 4;
>
>
> No, I think that's intentional. After the creation, indeed 20% of the table
> is empty. For example, if num_vars is 100, size_vars is 125. And 100/125 =
> 0.80.
>
> In add_guc_variable, where the table is enlarged, it says:
>
>> /*
>> * Increase the vector by 25%
>> */
>> int size_vars = size_guc_variables +
>> size_guc_variables / 4;
>
>
> That's correct too. The table is enlarged by 25%, so after the operation,
> 20% of it is again free. Subtle ;-)
>
> (Although I don't think "increase" is the correct term here. Should be
> "enlarge", or "increase the *size* of the vector by 25%".)
>
Oh I see. Thank you for explain!
I think so too, 'enlarged' should be used in here.
Regards,
-------
Sawada Masahiko
From | Date | Subject | |
---|---|---|---|
Next Message | Pavel Stehule | 2015-01-26 13:44:39 | Re: PL/pgSQL, RAISE and error context |
Previous Message | Heikki Linnakangas | 2015-01-26 13:06:35 | Re: fix typo in guc.c |