Re: PENDING_LIST_CLEANUP_SIZE - maximum size of GIN pending list Re: HEAD seems to generate larger WAL regarding GIN index

Lists: pgsql-hackers
From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Jesper Krogh <jesper(at)krogh(dot)cc>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: PENDING_LIST_CLEANUP_SIZE - maximum size of GIN pending list Re: HEAD seems to generate larger WAL regarding GIN index
Date: 2014-08-08 14:43:20
Message-ID: CAHGQGwGN_=cG4Ad8eC5DDZ+FWJ-Haggv1TmHiPs+2eaek1210Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Mon, Apr 14, 2014 at 11:40 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Fujii Masao <masao(dot)fujii(at)gmail(dot)com> writes:
>> On Tue, Apr 1, 2014 at 1:41 AM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
>>> Should we try to install some hack around fastupdate for 9.4? I fear
>>> the divergence between reasonable values of work_mem and reasonable
>>> sizes for that list is only going to continue to get bigger. I'm sure
>>> there's somebody out there who has work_mem = 16GB, and stuff like
>>> 263865a48973767ce8ed7b7788059a38a24a9f37 is only going to increase the
>>> appeal of large values.
>
>> Controlling the threshold of the size of pending list only by GUC doesn't
>> seem reasonable. Users may want to increase the threshold only for the
>> GIN index which can be updated heavily, and decrease it otherwise. So
>> I think that it's better to add new storage parameter for GIN index to control
>> the threshold, or both storage parameter and GUC.
>
> Yeah, -1 for a GUC. A GIN-index-specific storage parameter seems more
> appropriate.

The attached patch introduces the GIN index storage parameter
"PENDING_LIST_CLEANUP_SIZE" which specifies the maximum size of
GIN pending list. If it's not set, work_mem is used as that maximum size,
instead. So this patch doesn't break the existing application which
currently uses work_mem as the threshold of cleanup operation of
the pending list. It has only not to set PENDING_LIST_CLEANUP_SIZE.

This is an index storage parameter, and allows us to specify each
threshold per GIN index. So, for example, we can increase the threshold
only for the GIN index which can be updated heavily, and decrease it otherwise.

This patch uses another patch that I proposed (*1) as an infrastructure.
Please apply that infrastructure patch first if you apply this patch.

(*1)
http://www.postgresql.org/message-id/CAHGQGwEanQ_e8WLHL25=bm_8Z5zkyZw0K0yiR+kdMV2HgnE9FQ@mail.gmail.com

Regards,

--
Fujii Masao


From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Jesper Krogh <jesper(at)krogh(dot)cc>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: PENDING_LIST_CLEANUP_SIZE - maximum size of GIN pending list Re: HEAD seems to generate larger WAL regarding GIN index
Date: 2014-08-08 14:45:07
Message-ID: CAHGQGwH2NF7fuiRyfALBZct2GFuzRShsFtY3VLs8uZgLTAgR7g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Fri, Aug 8, 2014 at 11:43 PM, Fujii Masao <masao(dot)fujii(at)gmail(dot)com> wrote:
> On Mon, Apr 14, 2014 at 11:40 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> Fujii Masao <masao(dot)fujii(at)gmail(dot)com> writes:
>>> On Tue, Apr 1, 2014 at 1:41 AM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
>>>> Should we try to install some hack around fastupdate for 9.4? I fear
>>>> the divergence between reasonable values of work_mem and reasonable
>>>> sizes for that list is only going to continue to get bigger. I'm sure
>>>> there's somebody out there who has work_mem = 16GB, and stuff like
>>>> 263865a48973767ce8ed7b7788059a38a24a9f37 is only going to increase the
>>>> appeal of large values.
>>
>>> Controlling the threshold of the size of pending list only by GUC doesn't
>>> seem reasonable. Users may want to increase the threshold only for the
>>> GIN index which can be updated heavily, and decrease it otherwise. So
>>> I think that it's better to add new storage parameter for GIN index to control
>>> the threshold, or both storage parameter and GUC.
>>
>> Yeah, -1 for a GUC. A GIN-index-specific storage parameter seems more
>> appropriate.
>
> The attached patch introduces the GIN index storage parameter
> "PENDING_LIST_CLEANUP_SIZE" which specifies the maximum size of
> GIN pending list. If it's not set, work_mem is used as that maximum size,
> instead. So this patch doesn't break the existing application which
> currently uses work_mem as the threshold of cleanup operation of
> the pending list. It has only not to set PENDING_LIST_CLEANUP_SIZE.
>
> This is an index storage parameter, and allows us to specify each
> threshold per GIN index. So, for example, we can increase the threshold
> only for the GIN index which can be updated heavily, and decrease it otherwise.
>
> This patch uses another patch that I proposed (*1) as an infrastructure.
> Please apply that infrastructure patch first if you apply this patch.
>
> (*1)
> http://www.postgresql.org/message-id/CAHGQGwEanQ_e8WLHL25=bm_8Z5zkyZw0K0yiR+kdMV2HgnE9FQ@mail.gmail.com
>
> Regards,
>
> --
> Fujii Masao

Sorry, I forgot to attached the patch.... This time, attached.

Regards,

--
Fujii Masao

Attachment Content-Type Size
pending_list_cleanup_size_v1.patch text/x-patch 34.9 KB

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Robert Haas <robertmhaas(at)gmail(dot)com>, Jesper Krogh <jesper(at)krogh(dot)cc>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: PENDING_LIST_CLEANUP_SIZE - maximum size of GIN pending list Re: HEAD seems to generate larger WAL regarding GIN index
Date: 2014-08-08 14:52:41
Message-ID: CAB7nPqRMVsLVqoxQbJY6e71_i1_p4y3FiCzKThkpSXC4aRK=YA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Fri, Aug 8, 2014 at 11:43 PM, Fujii Masao <masao(dot)fujii(at)gmail(dot)com> wrote:
> The attached patch introduces...
A patch perhaps? :)
--
Michael


From: Sawada Masahiko <sawada(dot)mshk(at)gmail(dot)com>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Robert Haas <robertmhaas(at)gmail(dot)com>, Jesper Krogh <jesper(at)krogh(dot)cc>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: PENDING_LIST_CLEANUP_SIZE - maximum size of GIN pending list Re: HEAD seems to generate larger WAL regarding GIN index
Date: 2014-08-16 07:23:31
Message-ID: CAD21AoALmVVafzow-yN62Mxm8uroZGi9hHXyc3H1tXbLOZsPLw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Fri, Aug 8, 2014 at 11:45 PM, Fujii Masao <masao(dot)fujii(at)gmail(dot)com> wrote:
> On Fri, Aug 8, 2014 at 11:43 PM, Fujii Masao <masao(dot)fujii(at)gmail(dot)com> wrote:
>> On Mon, Apr 14, 2014 at 11:40 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>>> Fujii Masao <masao(dot)fujii(at)gmail(dot)com> writes:
>>>> On Tue, Apr 1, 2014 at 1:41 AM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
>>>>> Should we try to install some hack around fastupdate for 9.4? I fear
>>>>> the divergence between reasonable values of work_mem and reasonable
>>>>> sizes for that list is only going to continue to get bigger. I'm sure
>>>>> there's somebody out there who has work_mem = 16GB, and stuff like
>>>>> 263865a48973767ce8ed7b7788059a38a24a9f37 is only going to increase the
>>>>> appeal of large values.
>>>
>>>> Controlling the threshold of the size of pending list only by GUC doesn't
>>>> seem reasonable. Users may want to increase the threshold only for the
>>>> GIN index which can be updated heavily, and decrease it otherwise. So
>>>> I think that it's better to add new storage parameter for GIN index to control
>>>> the threshold, or both storage parameter and GUC.
>>>
>>> Yeah, -1 for a GUC. A GIN-index-specific storage parameter seems more
>>> appropriate.
>>
>> The attached patch introduces the GIN index storage parameter
>> "PENDING_LIST_CLEANUP_SIZE" which specifies the maximum size of
>> GIN pending list. If it's not set, work_mem is used as that maximum size,
>> instead. So this patch doesn't break the existing application which
>> currently uses work_mem as the threshold of cleanup operation of
>> the pending list. It has only not to set PENDING_LIST_CLEANUP_SIZE.
>>
>> This is an index storage parameter, and allows us to specify each
>> threshold per GIN index. So, for example, we can increase the threshold
>> only for the GIN index which can be updated heavily, and decrease it otherwise.
>>
>> This patch uses another patch that I proposed (*1) as an infrastructure.
>> Please apply that infrastructure patch first if you apply this patch.
>>
>> (*1)
>> http://www.postgresql.org/message-id/CAHGQGwEanQ_e8WLHL25=bm_8Z5zkyZw0K0yiR+kdMV2HgnE9FQ@mail.gmail.com
>>
>> Regards,
>>
>> --
>> Fujii Masao
>
> Sorry, I forgot to attached the patch.... This time, attached.
>

I think that this patch should be rebased.
It contains garbage code.

Regards,

-------
Sawada Masahiko


From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Sawada Masahiko <sawada(dot)mshk(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Robert Haas <robertmhaas(at)gmail(dot)com>, Jesper Krogh <jesper(at)krogh(dot)cc>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: PENDING_LIST_CLEANUP_SIZE - maximum size of GIN pending list Re: HEAD seems to generate larger WAL regarding GIN index
Date: 2014-08-18 02:46:27
Message-ID: CAHGQGwEffKKoOZ-4EkaK414zzTf3m26R=koHt+nQh0wqoUKQpw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Sat, Aug 16, 2014 at 4:23 PM, Sawada Masahiko <sawada(dot)mshk(at)gmail(dot)com> wrote:
> On Fri, Aug 8, 2014 at 11:45 PM, Fujii Masao <masao(dot)fujii(at)gmail(dot)com> wrote:
>> On Fri, Aug 8, 2014 at 11:43 PM, Fujii Masao <masao(dot)fujii(at)gmail(dot)com> wrote:
>>> On Mon, Apr 14, 2014 at 11:40 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>>>> Fujii Masao <masao(dot)fujii(at)gmail(dot)com> writes:
>>>>> On Tue, Apr 1, 2014 at 1:41 AM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
>>>>>> Should we try to install some hack around fastupdate for 9.4? I fear
>>>>>> the divergence between reasonable values of work_mem and reasonable
>>>>>> sizes for that list is only going to continue to get bigger. I'm sure
>>>>>> there's somebody out there who has work_mem = 16GB, and stuff like
>>>>>> 263865a48973767ce8ed7b7788059a38a24a9f37 is only going to increase the
>>>>>> appeal of large values.
>>>>
>>>>> Controlling the threshold of the size of pending list only by GUC doesn't
>>>>> seem reasonable. Users may want to increase the threshold only for the
>>>>> GIN index which can be updated heavily, and decrease it otherwise. So
>>>>> I think that it's better to add new storage parameter for GIN index to control
>>>>> the threshold, or both storage parameter and GUC.
>>>>
>>>> Yeah, -1 for a GUC. A GIN-index-specific storage parameter seems more
>>>> appropriate.
>>>
>>> The attached patch introduces the GIN index storage parameter
>>> "PENDING_LIST_CLEANUP_SIZE" which specifies the maximum size of
>>> GIN pending list. If it's not set, work_mem is used as that maximum size,
>>> instead. So this patch doesn't break the existing application which
>>> currently uses work_mem as the threshold of cleanup operation of
>>> the pending list. It has only not to set PENDING_LIST_CLEANUP_SIZE.
>>>
>>> This is an index storage parameter, and allows us to specify each
>>> threshold per GIN index. So, for example, we can increase the threshold
>>> only for the GIN index which can be updated heavily, and decrease it otherwise.
>>>
>>> This patch uses another patch that I proposed (*1) as an infrastructure.
>>> Please apply that infrastructure patch first if you apply this patch.
>>>
>>> (*1)
>>> http://www.postgresql.org/message-id/CAHGQGwEanQ_e8WLHL25=bm_8Z5zkyZw0K0yiR+kdMV2HgnE9FQ@mail.gmail.com
>>>
>>> Regards,
>>>
>>> --
>>> Fujii Masao
>>
>> Sorry, I forgot to attached the patch.... This time, attached.
>>
>
> I think that this patch should be rebased.
> It contains garbage code.

Thanks for reviewing the patch! ISTM that I failed to make the patch from
my git repository... Attached is the rebased version.

Regards,

--
Fujii Masao

Attachment Content-Type Size
pending_list_cleanup_size_v2.patch text/x-patch 8.9 KB

From: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: Sawada Masahiko <sawada(dot)mshk(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Robert Haas <robertmhaas(at)gmail(dot)com>, Jesper Krogh <jesper(at)krogh(dot)cc>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: PENDING_LIST_CLEANUP_SIZE - maximum size of GIN pending list Re: HEAD seems to generate larger WAL regarding GIN index
Date: 2014-09-08 16:28:12
Message-ID: CAMkU=1zL04S3YFj-T3wFSGsyuQZR+t9O8atdYyjCzYER1zNOhQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Sun, Aug 17, 2014 at 7:46 PM, Fujii Masao <masao(dot)fujii(at)gmail(dot)com> wrote:

>
> Thanks for reviewing the patch! ISTM that I failed to make the patch from
> my git repository... Attached is the rebased version.
>

I get some compiler warnings on v2 of this patch:

reloptions.c:219: warning: excess elements in struct initializer
reloptions.c:219: warning: (near initialization for 'intRelOpts[15]')

Cheers,

Jeff


From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
Cc: Sawada Masahiko <sawada(dot)mshk(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Robert Haas <robertmhaas(at)gmail(dot)com>, Jesper Krogh <jesper(at)krogh(dot)cc>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: PENDING_LIST_CLEANUP_SIZE - maximum size of GIN pending list Re: HEAD seems to generate larger WAL regarding GIN index
Date: 2014-09-09 13:17:01
Message-ID: CAHGQGwGW2azHsONb=LfbRn4LdQAYPnjGiUqveKypCVgD9a2Utw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Tue, Sep 9, 2014 at 1:28 AM, Jeff Janes <jeff(dot)janes(at)gmail(dot)com> wrote:
> On Sun, Aug 17, 2014 at 7:46 PM, Fujii Masao <masao(dot)fujii(at)gmail(dot)com> wrote:
>>
>>
>> Thanks for reviewing the patch! ISTM that I failed to make the patch from
>> my git repository... Attached is the rebased version.
>
>
>
> I get some compiler warnings on v2 of this patch:
>
> reloptions.c:219: warning: excess elements in struct initializer
> reloptions.c:219: warning: (near initialization for 'intRelOpts[15]')

Thanks for testing the patch!
Attached is the updated version of the patch.

Previously the patch depended on another infrastructure patch
(which allows a user to specify the unit in reloption (*1)). But that
infrastructure patch has serious problem and it's not easy to fix
the problem. So I changed the patch so that it doesn't depend on
that infrastructure patch at all. Even without the infrastructure
patch, the feature that this patch introduces is useful.

Also I added the regression test into the patch.

(*1)
http://www.postgresql.org/message-id/CAHGQGwEanQ_e8WLHL25=bm_8Z5zkyZw0K0yiR+kdMV2HgnE9FQ@mail.gmail.com

Regards,

--
Fujii Masao

Attachment Content-Type Size
pending_list_cleanup_size_v3.patch text/x-patch 11.2 KB

From: Etsuro Fujita <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
Cc: Sawada Masahiko <sawada(dot)mshk(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Robert Haas <robertmhaas(at)gmail(dot)com>, Jesper Krogh <jesper(at)krogh(dot)cc>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: PENDING_LIST_CLEANUP_SIZE - maximum size of GIN pending list Re: HEAD seems to generate larger WAL regarding GIN index
Date: 2014-09-10 03:15:43
Message-ID: 540FC25F.6040404@lab.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

(2014/09/09 22:17), Fujii Masao wrote:
> On Tue, Sep 9, 2014 at 1:28 AM, Jeff Janes <jeff(dot)janes(at)gmail(dot)com> wrote:
>> I get some compiler warnings on v2 of this patch:
>>
>> reloptions.c:219: warning: excess elements in struct initializer
>> reloptions.c:219: warning: (near initialization for 'intRelOpts[15]')

> Attached is the updated version of the patch.

Thank you for updating the patch!

I took a quick review on the patch. It looks good to me, but one thing
I'm concerned about is

You wrote:
>>>> The attached patch introduces the GIN index storage parameter
>>>> "PENDING_LIST_CLEANUP_SIZE" which specifies the maximum size of
>>>> GIN pending list. If it's not set, work_mem is used as that
maximum size,
>>>> instead. So this patch doesn't break the existing application which
>>>> currently uses work_mem as the threshold of cleanup operation of
>>>> the pending list. It has only not to set PENDING_LIST_CLEANUP_SIZE.

As you mentioned, I think it's important to consider for the existing
applications, but I'm wondering if it would be a bit confusing users to
have two parameters, PENDING_LIST_CLEANUP_SIZE and work_mem, for this
setting. Wouldn't it be easy-to-use to have only one parameter,
PENDING_LIST_CLEANUP_SIZE? How about setting PENDING_LIST_CLEANUP_SIZE
to work_mem as the default value when running the CREATE INDEX command?

Sorry for the delay.

Best regards,
Etsuro Fujita


From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Etsuro Fujita <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp>
Cc: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>, Sawada Masahiko <sawada(dot)mshk(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Robert Haas <robertmhaas(at)gmail(dot)com>, Jesper Krogh <jesper(at)krogh(dot)cc>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: PENDING_LIST_CLEANUP_SIZE - maximum size of GIN pending list Re: HEAD seems to generate larger WAL regarding GIN index
Date: 2014-09-10 03:31:21
Message-ID: CAHGQGwG0o+E=3FmCgdSP_WWw2jx0Do3MtOT+H_57+otLN=jbNA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Wed, Sep 10, 2014 at 12:15 PM, Etsuro Fujita
<fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp> wrote:
> (2014/09/09 22:17), Fujii Masao wrote:
>>
>> On Tue, Sep 9, 2014 at 1:28 AM, Jeff Janes <jeff(dot)janes(at)gmail(dot)com> wrote:
>>>
>>> I get some compiler warnings on v2 of this patch:
>>>
>>> reloptions.c:219: warning: excess elements in struct initializer
>>> reloptions.c:219: warning: (near initialization for 'intRelOpts[15]')
>
>
>> Attached is the updated version of the patch.
>
>
> Thank you for updating the patch!
>
> I took a quick review on the patch. It looks good to me,

Thanks for reviewing the patch!

> but one thing I'm
> concerned about is
>
> You wrote:
>>>>> The attached patch introduces the GIN index storage parameter
>>>>> "PENDING_LIST_CLEANUP_SIZE" which specifies the maximum size of
>>>>> GIN pending list. If it's not set, work_mem is used as that maximum
>>>>> size,
>>>>> instead. So this patch doesn't break the existing application which
>>>>> currently uses work_mem as the threshold of cleanup operation of
>>>>> the pending list. It has only not to set PENDING_LIST_CLEANUP_SIZE.
>
> As you mentioned, I think it's important to consider for the existing
> applications, but I'm wondering if it would be a bit confusing users to have
> two parameters,

Yep.

> PENDING_LIST_CLEANUP_SIZE and work_mem, for this setting.
> Wouldn't it be easy-to-use to have only one parameter,
> PENDING_LIST_CLEANUP_SIZE? How about setting PENDING_LIST_CLEANUP_SIZE to
> work_mem as the default value when running the CREATE INDEX command?

That's an idea. But there might be some users who want to change
the cleanup size per session like they can do by setting work_mem,
and your idea would prevent them from doing that...

So what about introduing pending_list_cleanup_size also as GUC?
That is, users can set the threshold by using either the reloption or
GUC.

> Sorry for the delay.

No problem. Thanks!

Regards,

--
Fujii Masao


From: Etsuro Fujita <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>, Sawada Masahiko <sawada(dot)mshk(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Robert Haas <robertmhaas(at)gmail(dot)com>, Jesper Krogh <jesper(at)krogh(dot)cc>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: PENDING_LIST_CLEANUP_SIZE - maximum size of GIN pending list Re: HEAD seems to generate larger WAL regarding GIN index
Date: 2014-09-10 08:35:11
Message-ID: 54100D3F.10102@lab.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

(2014/09/10 12:31), Fujii Masao wrote:
> On Wed, Sep 10, 2014 at 12:15 PM, Etsuro Fujita
> <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp> wrote:
>> (2014/09/09 22:17), Fujii Masao wrote:
>>> Attached is the updated version of the patch.

>> I took a quick review on the patch. It looks good to me,

>> but one thing I'm
>> concerned about is
>>
>> You wrote:
>>>>>> The attached patch introduces the GIN index storage parameter
>>>>>> "PENDING_LIST_CLEANUP_SIZE" which specifies the maximum size of
>>>>>> GIN pending list. If it's not set, work_mem is used as that maximum
>>>>>> size,
>>>>>> instead. So this patch doesn't break the existing application which
>>>>>> currently uses work_mem as the threshold of cleanup operation of
>>>>>> the pending list. It has only not to set PENDING_LIST_CLEANUP_SIZE.
>>
>> As you mentioned, I think it's important to consider for the existing
>> applications, but I'm wondering if it would be a bit confusing users to have
>> two parameters,
>
> Yep.
>
>> PENDING_LIST_CLEANUP_SIZE and work_mem, for this setting.
>> Wouldn't it be easy-to-use to have only one parameter,
>> PENDING_LIST_CLEANUP_SIZE? How about setting PENDING_LIST_CLEANUP_SIZE to
>> work_mem as the default value when running the CREATE INDEX command?
>
> That's an idea. But there might be some users who want to change
> the cleanup size per session like they can do by setting work_mem,
> and your idea would prevent them from doing that...

Why not use ALTER INDEX ... SET (PENDING_LIST_CLEANUP_SIZE= ...)? Maybe
I'm missing something, though.

> So what about introduing pending_list_cleanup_size also as GUC?
> That is, users can set the threshold by using either the reloption or
> GUC.

Yeah, that's an idea. So, I'd like to hear the opinions of others.

Thanks,

Best regards,
Etsuro Fujita


From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Etsuro Fujita <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp>
Cc: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>, Sawada Masahiko <sawada(dot)mshk(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Robert Haas <robertmhaas(at)gmail(dot)com>, Jesper Krogh <jesper(at)krogh(dot)cc>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: PENDING_LIST_CLEANUP_SIZE - maximum size of GIN pending list Re: HEAD seems to generate larger WAL regarding GIN index
Date: 2014-09-10 09:55:13
Message-ID: CAHGQGwENXY2YWQJz3=omkYdDJHGk0LrtCMxZnfdjiP8pzKFnMQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Wed, Sep 10, 2014 at 5:35 PM, Etsuro Fujita
<fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp> wrote:
> (2014/09/10 12:31), Fujii Masao wrote:
>>
>> On Wed, Sep 10, 2014 at 12:15 PM, Etsuro Fujita
>> <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp> wrote:
>>>
>>> (2014/09/09 22:17), Fujii Masao wrote:
>>>>
>>>> Attached is the updated version of the patch.
>
>
>>> I took a quick review on the patch. It looks good to me,
>
>
>>> but one thing I'm
>>> concerned about is
>>>
>>> You wrote:
>>>>>>>
>>>>>>> The attached patch introduces the GIN index storage parameter
>>>>>>> "PENDING_LIST_CLEANUP_SIZE" which specifies the maximum size of
>>>>>>> GIN pending list. If it's not set, work_mem is used as that maximum
>>>>>>> size,
>>>>>>> instead. So this patch doesn't break the existing application which
>>>>>>> currently uses work_mem as the threshold of cleanup operation of
>>>>>>> the pending list. It has only not to set PENDING_LIST_CLEANUP_SIZE.
>>>
>>>
>>> As you mentioned, I think it's important to consider for the existing
>>> applications, but I'm wondering if it would be a bit confusing users to
>>> have
>>> two parameters,
>>
>>
>> Yep.
>>
>>> PENDING_LIST_CLEANUP_SIZE and work_mem, for this setting.
>>> Wouldn't it be easy-to-use to have only one parameter,
>>> PENDING_LIST_CLEANUP_SIZE? How about setting PENDING_LIST_CLEANUP_SIZE
>>> to
>>> work_mem as the default value when running the CREATE INDEX command?
>>
>>
>> That's an idea. But there might be some users who want to change
>> the cleanup size per session like they can do by setting work_mem,
>> and your idea would prevent them from doing that...
>
>
> Why not use ALTER INDEX ... SET (PENDING_LIST_CLEANUP_SIZE= ...)? Maybe I'm
> missing something, though.

It takes AccessExclusive lock and has an effect on every sessions
(not only specified session).

Regards,

--
Fujii Masao


From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: Etsuro Fujita <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp>, Jeff Janes <jeff(dot)janes(at)gmail(dot)com>, Sawada Masahiko <sawada(dot)mshk(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Robert Haas <robertmhaas(at)gmail(dot)com>, Jesper Krogh <jesper(at)krogh(dot)cc>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: PENDING_LIST_CLEANUP_SIZE - maximum size of GIN pending list Re: HEAD seems to generate larger WAL regarding GIN index
Date: 2014-09-10 13:37:42
Message-ID: 20140910133742.GA4701@eldon.alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Fujii Masao wrote:
> On Wed, Sep 10, 2014 at 12:15 PM, Etsuro Fujita
> <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp> wrote:

> > PENDING_LIST_CLEANUP_SIZE and work_mem, for this setting.
> > Wouldn't it be easy-to-use to have only one parameter,
> > PENDING_LIST_CLEANUP_SIZE? How about setting PENDING_LIST_CLEANUP_SIZE to
> > work_mem as the default value when running the CREATE INDEX command?
>
> That's an idea. But there might be some users who want to change
> the cleanup size per session like they can do by setting work_mem,
> and your idea would prevent them from doing that...
>
> So what about introduing pending_list_cleanup_size also as GUC?
> That is, users can set the threshold by using either the reloption or
> GUC.

Yes, I think having both a GUC and a reloption makes sense -- the GUC
applies to all indexes, and can be tweaked for individual indexes using
the reloption.

I'm not sure about the idea of being able to change it per session,
though. Do you mean that you would like insert processes use a very
large value so that they can just append new values to the pending list,
and have vacuum use a small value so that it cleans up as soon as it
runs? Two things: 1. we could have an "autovacuum_" reloption which
only changes what autovacuum does; 2. we could have autovacuum run
index cleanup actions separately from actual vacuuming.

--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services


From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: Etsuro Fujita <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp>, Jeff Janes <jeff(dot)janes(at)gmail(dot)com>, Sawada Masahiko <sawada(dot)mshk(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Robert Haas <robertmhaas(at)gmail(dot)com>, Jesper Krogh <jesper(at)krogh(dot)cc>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: PENDING_LIST_CLEANUP_SIZE - maximum size of GIN pending list Re: HEAD seems to generate larger WAL regarding GIN index
Date: 2014-09-12 17:42:34
Message-ID: CAHGQGwEU6wgBLxPneyKaSxuM32sN9DT1w1gYYjiv=_hDXgJaLw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Wed, Sep 10, 2014 at 10:37 PM, Alvaro Herrera
<alvherre(at)2ndquadrant(dot)com> wrote:
> Fujii Masao wrote:
>> On Wed, Sep 10, 2014 at 12:15 PM, Etsuro Fujita
>> <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp> wrote:
>
>> > PENDING_LIST_CLEANUP_SIZE and work_mem, for this setting.
>> > Wouldn't it be easy-to-use to have only one parameter,
>> > PENDING_LIST_CLEANUP_SIZE? How about setting PENDING_LIST_CLEANUP_SIZE to
>> > work_mem as the default value when running the CREATE INDEX command?
>>
>> That's an idea. But there might be some users who want to change
>> the cleanup size per session like they can do by setting work_mem,
>> and your idea would prevent them from doing that...
>>
>> So what about introduing pending_list_cleanup_size also as GUC?
>> That is, users can set the threshold by using either the reloption or
>> GUC.
>
> Yes, I think having both a GUC and a reloption makes sense -- the GUC
> applies to all indexes, and can be tweaked for individual indexes using
> the reloption.

Agreed.

> I'm not sure about the idea of being able to change it per session,
> though. Do you mean that you would like insert processes use a very
> large value so that they can just append new values to the pending list,
> and have vacuum use a small value so that it cleans up as soon as it
> runs? Two things: 1. we could have an "autovacuum_" reloption which
> only changes what autovacuum does; 2. we could have autovacuum run
> index cleanup actions separately from actual vacuuming.

Yes, I was thinking something like that. But if autovacuum
has already been able to handle that, it's nice. Anyway,
as you pointed out, it's better to have both GUC and reloption
for the cleanup size of pending list.

Regards,

--
Fujii Masao


From: Etsuro Fujita <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>, Sawada Masahiko <sawada(dot)mshk(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Robert Haas <robertmhaas(at)gmail(dot)com>, Jesper Krogh <jesper(at)krogh(dot)cc>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: PENDING_LIST_CLEANUP_SIZE - maximum size of GIN pending list Re: HEAD seems to generate larger WAL regarding GIN index
Date: 2014-09-24 02:10:06
Message-ID: 542227FE.8020501@lab.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

(2014/09/13 2:42), Fujii Masao wrote:
> On Wed, Sep 10, 2014 at 10:37 PM, Alvaro Herrera
> <alvherre(at)2ndquadrant(dot)com> wrote:
>> Fujii Masao wrote:
>>> On Wed, Sep 10, 2014 at 12:15 PM, Etsuro Fujita
>>> <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp> wrote:
>>
>>>> PENDING_LIST_CLEANUP_SIZE and work_mem, for this setting.
>>>> Wouldn't it be easy-to-use to have only one parameter,
>>>> PENDING_LIST_CLEANUP_SIZE? How about setting PENDING_LIST_CLEANUP_SIZE to
>>>> work_mem as the default value when running the CREATE INDEX command?
>>>
>>> That's an idea. But there might be some users who want to change
>>> the cleanup size per session like they can do by setting work_mem,
>>> and your idea would prevent them from doing that...
>>>
>>> So what about introduing pending_list_cleanup_size also as GUC?
>>> That is, users can set the threshold by using either the reloption or
>>> GUC.
>>
>> Yes, I think having both a GUC and a reloption makes sense -- the GUC
>> applies to all indexes, and can be tweaked for individual indexes using
>> the reloption.
>
> Agreed.
>
>> I'm not sure about the idea of being able to change it per session,
>> though. Do you mean that you would like insert processes use a very
>> large value so that they can just append new values to the pending list,
>> and have vacuum use a small value so that it cleans up as soon as it
>> runs? Two things: 1. we could have an "autovacuum_" reloption which
>> only changes what autovacuum does; 2. we could have autovacuum run
>> index cleanup actions separately from actual vacuuming.
>
> Yes, I was thinking something like that. But if autovacuum
> has already been able to handle that, it's nice. Anyway,
> as you pointed out, it's better to have both GUC and reloption
> for the cleanup size of pending list.

OK, I'd vote for your idea of having both the GUC and the reloption.
So, I think the patch needs to be updated. Fujii-san, what plan do you
have about the patch?

Sorry for the delay.

Thanks,

Best regards,
Etsuro Fujita


From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Etsuro Fujita <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp>
Cc: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Jeff Janes <jeff(dot)janes(at)gmail(dot)com>, Sawada Masahiko <sawada(dot)mshk(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Robert Haas <robertmhaas(at)gmail(dot)com>, Jesper Krogh <jesper(at)krogh(dot)cc>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: PENDING_LIST_CLEANUP_SIZE - maximum size of GIN pending list Re: HEAD seems to generate larger WAL regarding GIN index
Date: 2014-10-08 13:51:01
Message-ID: CAHGQGwEGA1dh0WbNxJaqebfxj9ReD7oce7QyxNCzU=sgzkAEDw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Wed, Sep 24, 2014 at 11:10 AM, Etsuro Fujita
<fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp> wrote:
> (2014/09/13 2:42), Fujii Masao wrote:
>>
>> On Wed, Sep 10, 2014 at 10:37 PM, Alvaro Herrera
>> <alvherre(at)2ndquadrant(dot)com> wrote:
>>>
>>> Fujii Masao wrote:
>>>>
>>>> On Wed, Sep 10, 2014 at 12:15 PM, Etsuro Fujita
>>>> <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp> wrote:
>>>
>>>
>>>>> PENDING_LIST_CLEANUP_SIZE and work_mem, for this setting.
>>>>> Wouldn't it be easy-to-use to have only one parameter,
>>>>> PENDING_LIST_CLEANUP_SIZE? How about setting PENDING_LIST_CLEANUP_SIZE
>>>>> to
>>>>> work_mem as the default value when running the CREATE INDEX command?
>>>>
>>>>
>>>> That's an idea. But there might be some users who want to change
>>>> the cleanup size per session like they can do by setting work_mem,
>>>> and your idea would prevent them from doing that...
>>>>
>>>> So what about introduing pending_list_cleanup_size also as GUC?
>>>> That is, users can set the threshold by using either the reloption or
>>>> GUC.
>>>
>>>
>>> Yes, I think having both a GUC and a reloption makes sense -- the GUC
>>> applies to all indexes, and can be tweaked for individual indexes using
>>> the reloption.
>>
>>
>> Agreed.
>>
>>> I'm not sure about the idea of being able to change it per session,
>>> though. Do you mean that you would like insert processes use a very
>>> large value so that they can just append new values to the pending list,
>>> and have vacuum use a small value so that it cleans up as soon as it
>>> runs? Two things: 1. we could have an "autovacuum_" reloption which
>>> only changes what autovacuum does; 2. we could have autovacuum run
>>> index cleanup actions separately from actual vacuuming.
>>
>>
>> Yes, I was thinking something like that. But if autovacuum
>> has already been able to handle that, it's nice. Anyway,
>> as you pointed out, it's better to have both GUC and reloption
>> for the cleanup size of pending list.
>
>
> OK, I'd vote for your idea of having both the GUC and the reloption. So, I
> think the patch needs to be updated. Fujii-san, what plan do you have about
> the patch?

Please see the attached patch. In this patch, I introduced the GUC parameter,
pending_list_cleanup_size. I chose 4MB as the default value of the parameter.
But do you have any better idea about that default value?

BTW, I moved the CommitFest entry of this patch to next CF 2014-10.

Regards,

--
Fujii Masao

Attachment Content-Type Size
pending_list_cleanup_size_v4.patch text/x-patch 13.2 KB

From: Etsuro Fujita <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Jeff Janes <jeff(dot)janes(at)gmail(dot)com>, Sawada Masahiko <sawada(dot)mshk(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Robert Haas <robertmhaas(at)gmail(dot)com>, Jesper Krogh <jesper(at)krogh(dot)cc>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: PENDING_LIST_CLEANUP_SIZE - maximum size of GIN pending list Re: HEAD seems to generate larger WAL regarding GIN index
Date: 2014-10-09 02:49:19
Message-ID: 5435F7AF.1060005@lab.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

(2014/10/08 22:51), Fujii Masao wrote:
> On Wed, Sep 24, 2014 at 11:10 AM, Etsuro Fujita
> <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp> wrote:

>>> On Wed, Sep 10, 2014 at 10:37 PM, Alvaro Herrera
>>> <alvherre(at)2ndquadrant(dot)com> wrote:
>>>> Fujii Masao wrote:
>>>>> On Wed, Sep 10, 2014 at 12:15 PM, Etsuro Fujita
>>>>> <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp> wrote:

>>>>>> PENDING_LIST_CLEANUP_SIZE and work_mem, for this setting.
>>>>>> Wouldn't it be easy-to-use to have only one parameter,
>>>>>> PENDING_LIST_CLEANUP_SIZE? How about setting PENDING_LIST_CLEANUP_SIZE
>>>>>> to
>>>>>> work_mem as the default value when running the CREATE INDEX command?

>>>>> So what about introduing pending_list_cleanup_size also as GUC?
>>>>> That is, users can set the threshold by using either the reloption or
>>>>> GUC.

>>>> Yes, I think having both a GUC and a reloption makes sense -- the GUC
>>>> applies to all indexes, and can be tweaked for individual indexes using
>>>> the reloption.

>> OK, I'd vote for your idea of having both the GUC and the reloption. So, I
>> think the patch needs to be updated. Fujii-san, what plan do you have about
>> the patch?

> Please see the attached patch. In this patch, I introduced the GUC parameter,
> pending_list_cleanup_size. I chose 4MB as the default value of the parameter.
> But do you have any better idea about that default value?

It seems reasonable to me that the GUC has the same default value as
work_mem. So, +1 for the default value of 4MB.

> BTW, I moved the CommitFest entry of this patch to next CF 2014-10.

OK, I'll review the patch in the CF.

Thanks,

Best regards,
Etsuro Fujita


From: Etsuro Fujita <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Jeff Janes <jeff(dot)janes(at)gmail(dot)com>, Sawada Masahiko <sawada(dot)mshk(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Robert Haas <robertmhaas(at)gmail(dot)com>, Jesper Krogh <jesper(at)krogh(dot)cc>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: PENDING_LIST_CLEANUP_SIZE - maximum size of GIN pending list Re: HEAD seems to generate larger WAL regarding GIN index
Date: 2014-10-30 10:30:52
Message-ID: 5452135C.5010706@lab.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

(2014/10/09 11:49), Etsuro Fujita wrote:
> (2014/10/08 22:51), Fujii Masao wrote:
>> On Wed, Sep 24, 2014 at 11:10 AM, Etsuro Fujita
>> <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp> wrote:
>>>> On Wed, Sep 10, 2014 at 10:37 PM, Alvaro Herrera
>>>> <alvherre(at)2ndquadrant(dot)com> wrote:
>>>>> Fujii Masao wrote:
>>>>>> On Wed, Sep 10, 2014 at 12:15 PM, Etsuro Fujita
>>>>>> <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp> wrote:

>>>>>>> PENDING_LIST_CLEANUP_SIZE and work_mem, for this setting.
>>>>>>> Wouldn't it be easy-to-use to have only one parameter,
>>>>>>> PENDING_LIST_CLEANUP_SIZE? How about setting
>>>>>>> PENDING_LIST_CLEANUP_SIZE
>>>>>>> to
>>>>>>> work_mem as the default value when running the CREATE INDEX command?

>>>>>> So what about introduing pending_list_cleanup_size also as GUC?
>>>>>> That is, users can set the threshold by using either the reloption or
>>>>>> GUC.

>>>>> Yes, I think having both a GUC and a reloption makes sense -- the GUC
>>>>> applies to all indexes, and can be tweaked for individual indexes
>>>>> using
>>>>> the reloption.

>>> OK, I'd vote for your idea of having both the GUC and the reloption.
>>> So, I
>>> think the patch needs to be updated. Fujii-san, what plan do you
>>> have about
>>> the patch?

>> Please see the attached patch. In this patch, I introduced the GUC
>> parameter,
>> pending_list_cleanup_size. I chose 4MB as the default value of the
>> parameter.
>> But do you have any better idea about that default value?

> It seems reasonable to me that the GUC has the same default value as
> work_mem. So, +1 for the default value of 4MB.

>> BTW, I moved the CommitFest entry of this patch to next CF 2014-10.

> OK, I'll review the patch in the CF.

Thank you for updating the patch! Here are my review comments.

* The patch applies cleanly and make and make check run successfully. I
think that the patch is mostly good.

* In src/backend/utils/misc/guc.c:
+ {
+ {"pending_list_cleanup_size", PGC_USERSET, CLIENT_CONN_STATEMENT,
+ gettext_noop("Sets the maximum size of the pending list for GIN
index."),
+ NULL,
+ GUC_UNIT_KB
+ },
+ &pending_list_cleanup_size,
+ 4096, 0, MAX_KILOBYTES,
+ NULL, NULL, NULL
+ },

ISTM it'd be better to use RESOURCES_MEM, not CLIENT_CONN_STATEMENT. No?
Also why not set min to 64, not to 0, in accoradance with that of
work_mem?

* In src/backend/utils/misc/postgresql.conf.sample:
Likewise, why not put this variable in the section of RESOURCE USAGE,
not in that of CLIENT CONNECTION DEFAULTS.

* In src/backend/access/common/reloptions.c:
+ {
+ {
+ "pending_list_cleanup_size",
+ "Maximum size of the pending list for this GIN index, in kilobytes.",
+ RELOPT_KIND_GIN
+ },
+ -1, 0, MAX_KILOBYTES
+ },

As in guc.c, why not set min to 64, not to 0?

* In src/include/access/gin.h:
/* GUC parameter */
extern PGDLLIMPORT int GinFuzzySearchLimit;
+ extern int pending_list_cleanup_size;

The comment should be "GUC parameters".

* In src/backend/access/gin/ginfast.c:
+ /* GUC parameter */
+ int pending_list_cleanup_size = 0;

Do we need to substitute 0 for pending_list_cleanup_size?

* In doc/src/sgml/config.sgml:
+ <varlistentry id="guc-pending-list-cleanup-size"
xreflabel="pending_list_cleanup_size">
+ <term><varname>pending_list_cleanup_size</varname>
(<type>integer</type>)

As in postgresql.conf.sample, ISTM it'd be better to explain this
variable in the section of Resource Consumption (maybe in "Memory"), not
in that of Client Connection Defaults.

* In doc/src/sgml/gin.sgml:
! <literal>pending_list_cleanup_size</>. To avoid fluctuations in
observed

ISTM it'd be better to use <varname> for pending_list_cleanup_size, not
<literal>, here.

* In doc/src/sgml/ref/create_index.sgml:
+ <term><literal>PENDING_LIST_CLEANUP_SIZE</></term>

IMHO, it seems to me better for this variable to be in lowercase in
accordance with the GUC version. Also, I think that the words "GIN
indexes accept a different parameter:" in the section of "Index Storage
Parameters" in this reference page would be "GIN indexes accept
different parameters:".

Sorry for the delay in reviewing the patch.

Best regards,
Etsuro Fujita


From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Etsuro Fujita <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp>
Cc: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Jeff Janes <jeff(dot)janes(at)gmail(dot)com>, Sawada Masahiko <sawada(dot)mshk(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Robert Haas <robertmhaas(at)gmail(dot)com>, Jesper Krogh <jesper(at)krogh(dot)cc>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: PENDING_LIST_CLEANUP_SIZE - maximum size of GIN pending list Re: HEAD seems to generate larger WAL regarding GIN index
Date: 2014-10-30 12:30:41
Message-ID: CAHGQGwFGooZ7X_WMTAjNWaaLUSYop0xNn8=6xnN56QnqXWCwjg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Thu, Oct 30, 2014 at 7:30 PM, Etsuro Fujita
<fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp> wrote:
> (2014/10/09 11:49), Etsuro Fujita wrote:
>>
>> (2014/10/08 22:51), Fujii Masao wrote:
>>>
>>> On Wed, Sep 24, 2014 at 11:10 AM, Etsuro Fujita
>>> <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp> wrote:
>>>>>
>>>>> On Wed, Sep 10, 2014 at 10:37 PM, Alvaro Herrera
>>>>> <alvherre(at)2ndquadrant(dot)com> wrote:
>>>>>>
>>>>>> Fujii Masao wrote:
>>>>>>>
>>>>>>> On Wed, Sep 10, 2014 at 12:15 PM, Etsuro Fujita
>>>>>>> <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp> wrote:
>
>
>>>>>>>> PENDING_LIST_CLEANUP_SIZE and work_mem, for this setting.
>>>>>>>> Wouldn't it be easy-to-use to have only one parameter,
>>>>>>>> PENDING_LIST_CLEANUP_SIZE? How about setting
>>>>>>>> PENDING_LIST_CLEANUP_SIZE
>>>>>>>> to
>>>>>>>> work_mem as the default value when running the CREATE INDEX command?
>
>
>>>>>>> So what about introduing pending_list_cleanup_size also as GUC?
>>>>>>> That is, users can set the threshold by using either the reloption or
>>>>>>> GUC.
>
>
>>>>>> Yes, I think having both a GUC and a reloption makes sense -- the GUC
>>>>>> applies to all indexes, and can be tweaked for individual indexes
>>>>>> using
>>>>>> the reloption.
>
>
>>>> OK, I'd vote for your idea of having both the GUC and the reloption.
>>>> So, I
>>>> think the patch needs to be updated. Fujii-san, what plan do you
>>>> have about
>>>> the patch?
>
>
>>> Please see the attached patch. In this patch, I introduced the GUC
>>> parameter,
>>> pending_list_cleanup_size. I chose 4MB as the default value of the
>>> parameter.
>>> But do you have any better idea about that default value?
>
>
>> It seems reasonable to me that the GUC has the same default value as
>> work_mem. So, +1 for the default value of 4MB.
>
>
>>> BTW, I moved the CommitFest entry of this patch to next CF 2014-10.
>
>
>> OK, I'll review the patch in the CF.
>
>
> Thank you for updating the patch! Here are my review comments.
>
> * The patch applies cleanly and make and make check run successfully. I
> think that the patch is mostly good.

Thanks! Attached is the updated version of the patch.

> * In src/backend/utils/misc/guc.c:
> + {
> + {"pending_list_cleanup_size", PGC_USERSET,
> CLIENT_CONN_STATEMENT,
> + gettext_noop("Sets the maximum size of the pending
> list for GIN index."),
> + NULL,
> + GUC_UNIT_KB
> + },
> + &pending_list_cleanup_size,
> + 4096, 0, MAX_KILOBYTES,
> + NULL, NULL, NULL
> + },
>
> ISTM it'd be better to use RESOURCES_MEM, not CLIENT_CONN_STATEMENT. No?

Yes if the pending list always exists in the memory. But not, IIUC. Thought?

> Also why not set min to 64, not to 0, in accoradance with that of work_mem?

I'm OK to use 64. But I just chose 0 because I could not think of any reasonable
reason why 64k is suitable as the minimum size of the pending list.
IOW, I have no idea about whether it's reasonable to use the min value of
work_mem as the min size of the pending list.

> * In src/backend/utils/misc/postgresql.conf.sample:
> Likewise, why not put this variable in the section of RESOURCE USAGE, not in
> that of CLIENT CONNECTION DEFAULTS.

Same as above.

>
> * In src/backend/access/common/reloptions.c:
> + {
> + {
> + "pending_list_cleanup_size",
> + "Maximum size of the pending list for this GIN
> index, in kilobytes.",
> + RELOPT_KIND_GIN
> + },
> + -1, 0, MAX_KILOBYTES
> + },
>
> As in guc.c, why not set min to 64, not to 0?

Same as above.

> * In src/include/access/gin.h:
> /* GUC parameter */
> extern PGDLLIMPORT int GinFuzzySearchLimit;
> + extern int pending_list_cleanup_size;
>
> The comment should be "GUC parameters".

Yes, fixed.

> * In src/backend/access/gin/ginfast.c:
> + /* GUC parameter */
> + int pending_list_cleanup_size = 0;
>
> Do we need to substitute 0 for pending_list_cleanup_size?

Same as above.

>
> * In doc/src/sgml/config.sgml:
> + <varlistentry id="guc-pending-list-cleanup-size"
> xreflabel="pending_list_cleanup_size">
> + <term><varname>pending_list_cleanup_size</varname>
> (<type>integer</type>)
>
> As in postgresql.conf.sample, ISTM it'd be better to explain this variable
> in the section of Resource Consumption (maybe in "Memory"), not in that of
> Client Connection Defaults.

Same as above.

> * In doc/src/sgml/gin.sgml:
> ! <literal>pending_list_cleanup_size</>. To avoid fluctuations in
> observed
>
> ISTM it'd be better to use <varname> for pending_list_cleanup_size, not
> <literal>, here.

Yes, fixed.

> * In doc/src/sgml/ref/create_index.sgml:
> + <term><literal>PENDING_LIST_CLEANUP_SIZE</></term>
>
> IMHO, it seems to me better for this variable to be in lowercase in
> accordance with the GUC version.

Using lowercase only for pending_list_cleanup_size and uppercase for
other options
looks strange to me. What about using lowercase for all the storage options?
I changed the document in that way.

> Also, I think that the words "GIN indexes
> accept a different parameter:" in the section of "Index Storage Parameters"
> in this reference page would be "GIN indexes accept different parameters:".

Yes, fixed.

> Sorry for the delay in reviewing the patch.

No problem. Thanks!

Regards,

--
Fujii Masao

Attachment Content-Type Size
pending_list_cleanup_size_v5.patch text/x-patch 18.7 KB

From: Etsuro Fujita <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Jeff Janes <jeff(dot)janes(at)gmail(dot)com>, Sawada Masahiko <sawada(dot)mshk(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Robert Haas <robertmhaas(at)gmail(dot)com>, Jesper Krogh <jesper(at)krogh(dot)cc>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: PENDING_LIST_CLEANUP_SIZE - maximum size of GIN pending list Re: HEAD seems to generate larger WAL regarding GIN index
Date: 2014-11-04 03:04:54
Message-ID: 54584256.4030407@lab.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

(2014/10/30 21:30), Fujii Masao wrote:
> On Thu, Oct 30, 2014 at 7:30 PM, Etsuro Fujita
> <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp> wrote:

>> Here are my review comments.
>>
>> * The patch applies cleanly and make and make check run successfully. I
>> think that the patch is mostly good.
>
> Thanks! Attached is the updated version of the patch.

Thank you for updating the patch!

>> * In src/backend/utils/misc/guc.c:
>> + {
>> + {"pending_list_cleanup_size", PGC_USERSET,
>> CLIENT_CONN_STATEMENT,
>> + gettext_noop("Sets the maximum size of the pending
>> list for GIN index."),
>> + NULL,
>> + GUC_UNIT_KB
>> + },
>> + &pending_list_cleanup_size,
>> + 4096, 0, MAX_KILOBYTES,
>> + NULL, NULL, NULL
>> + },
>>
>> ISTM it'd be better to use RESOURCES_MEM, not CLIENT_CONN_STATEMENT. No?
>
> Yes if the pending list always exists in the memory. But not, IIUC. Thought?

Exactly. But I think we can expect that in many cases, since I think
that the users would often set the GUC to a small value to the extent
that most of the pending list pages would be cached by shared buffer, to
maintain *search* performance.

I'd like to hear the opinions of others about the category for the GUC.

>> Also why not set min to 64, not to 0, in accoradance with that of work_mem?
>
> I'm OK to use 64. But I just chose 0 because I could not think of any reasonable
> reason why 64k is suitable as the minimum size of the pending list.
> IOW, I have no idea about whether it's reasonable to use the min value of
> work_mem as the min size of the pending list.

IIUC, I think that min = 0 disables fast update, so ISTM that it'd be
appropriate to set min to some positive value. And ISTM that the idea
of using the min value of work_mem is not so bad.

>> * In doc/src/sgml/ref/create_index.sgml:
>> + <term><literal>PENDING_LIST_CLEANUP_SIZE</></term>
>>
>> IMHO, it seems to me better for this variable to be in lowercase in
>> accordance with the GUC version.
>
> Using lowercase only for pending_list_cleanup_size and uppercase for
> other options
> looks strange to me. What about using lowercase for all the storage options?

+1

> I changed the document in that way.

*** 356,361 **** CREATE [ UNIQUE ] INDEX [ CONCURRENTLY ] [ <replaceable
class="parameter">name</
--- 356,372 ----
</listitem>
</varlistentry>
</variablelist>
+ <variablelist>
+ <varlistentry>
+ <term><literal>PENDING_LIST_CLEANUP_SIZE</></term>

The above is still in uppercse.

Thanks,

Best regards,
Etsuro Fujita


From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Etsuro Fujita <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp>
Cc: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Jeff Janes <jeff(dot)janes(at)gmail(dot)com>, Sawada Masahiko <sawada(dot)mshk(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Robert Haas <robertmhaas(at)gmail(dot)com>, Jesper Krogh <jesper(at)krogh(dot)cc>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: PENDING_LIST_CLEANUP_SIZE - maximum size of GIN pending list Re: HEAD seems to generate larger WAL regarding GIN index
Date: 2014-11-06 14:38:13
Message-ID: CAHGQGwEMK2VFx28oRhAPh3LvDNnCavNSe75hNtVoex=PptKFPw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Tue, Nov 4, 2014 at 12:04 PM, Etsuro Fujita
<fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp> wrote:
> IIUC, I think that min = 0 disables fast update, so ISTM that it'd be
> appropriate to set min to some positive value. And ISTM that the idea of
> using the min value of work_mem is not so bad.

OK. I changed the min value to 64kB.

> *** 356,361 **** CREATE [ UNIQUE ] INDEX [ CONCURRENTLY ] [ <replaceable
> class="parameter">name</
> --- 356,372 ----
> </listitem>
> </varlistentry>
> </variablelist>
> + <variablelist>
> + <varlistentry>
> + <term><literal>PENDING_LIST_CLEANUP_SIZE</></term>
>
> The above is still in uppercse.

Fixed.

Attached is the updated version of the patch. Thanks for the review!

Regards,

--
Fujii Masao

Attachment Content-Type Size
pending_list_cleanup_size_v6.patch text/x-patch 18.7 KB

From: Etsuro Fujita <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Jeff Janes <jeff(dot)janes(at)gmail(dot)com>, Sawada Masahiko <sawada(dot)mshk(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Robert Haas <robertmhaas(at)gmail(dot)com>, Jesper Krogh <jesper(at)krogh(dot)cc>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: PENDING_LIST_CLEANUP_SIZE - maximum size of GIN pending list Re: HEAD seems to generate larger WAL regarding GIN index
Date: 2014-11-10 07:15:06
Message-ID: 546065FA.7070002@lab.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

(2014/11/06 23:38), Fujii Masao wrote:
> On Tue, Nov 4, 2014 at 12:04 PM, Etsuro Fujita
> <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp> wrote:
>> IIUC, I think that min = 0 disables fast update, so ISTM that it'd be
>> appropriate to set min to some positive value. And ISTM that the idea of
>> using the min value of work_mem is not so bad.
>
> OK. I changed the min value to 64kB.
>
>> *** 356,361 **** CREATE [ UNIQUE ] INDEX [ CONCURRENTLY ] [ <replaceable
>> class="parameter">name</
>> --- 356,372 ----
>> </listitem>
>> </varlistentry>
>> </variablelist>
>> + <variablelist>
>> + <varlistentry>
>> + <term><literal>PENDING_LIST_CLEANUP_SIZE</></term>
>>
>> The above is still in uppercse.
>
> Fixed.
>
> Attached is the updated version of the patch. Thanks for the review!

Thanks for the updating the patch!

The patch looks good to me except for the following point:

*** a/src/backend/access/gin/ginfast.c
--- b/src/backend/access/gin/ginfast.c
***************
*** 25,30 ****
--- 25,32 ----
#include "utils/memutils.h"
#include "utils/rel.h"

+ /* GUC parameter */
+ int pending_list_cleanup_size = 0;

I think we need to initialize the GUC to boot_val, 4096 in this case.

I asked the opinions of others about the config_group of the GUC. But
there seems no opinions, so I agree with Fujii-san's idea of assigning
the GUC CLIENT_CONN_STATEMENT.

Thanks,

Best regards,
Etsuro Fujita


From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Etsuro Fujita <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp>
Cc: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Jeff Janes <jeff(dot)janes(at)gmail(dot)com>, Sawada Masahiko <sawada(dot)mshk(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Robert Haas <robertmhaas(at)gmail(dot)com>, Jesper Krogh <jesper(at)krogh(dot)cc>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: PENDING_LIST_CLEANUP_SIZE - maximum size of GIN pending list Re: HEAD seems to generate larger WAL regarding GIN index
Date: 2014-11-10 17:31:57
Message-ID: CAHGQGwFFFeseo4iw18My2Krj-V=Oo0bY9VQgE+99rWOO1JRTfw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Mon, Nov 10, 2014 at 4:15 PM, Etsuro Fujita
<fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp> wrote:
> (2014/11/06 23:38), Fujii Masao wrote:
>>
>> On Tue, Nov 4, 2014 at 12:04 PM, Etsuro Fujita
>> <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp> wrote:
>>>
>>> IIUC, I think that min = 0 disables fast update, so ISTM that it'd be
>>> appropriate to set min to some positive value. And ISTM that the idea of
>>> using the min value of work_mem is not so bad.
>>
>>
>> OK. I changed the min value to 64kB.
>>
>>> *** 356,361 **** CREATE [ UNIQUE ] INDEX [ CONCURRENTLY ] [ <replaceable
>>> class="parameter">name</
>>> --- 356,372 ----
>>> </listitem>
>>> </varlistentry>
>>> </variablelist>
>>> + <variablelist>
>>> + <varlistentry>
>>> + <term><literal>PENDING_LIST_CLEANUP_SIZE</></term>
>>>
>>> The above is still in uppercse.
>>
>>
>> Fixed.
>>
>> Attached is the updated version of the patch. Thanks for the review!
>
>
> Thanks for the updating the patch!
>
> The patch looks good to me except for the following point:

Thanks for the review again!

>
> *** a/src/backend/access/gin/ginfast.c
> --- b/src/backend/access/gin/ginfast.c
> ***************
> *** 25,30 ****
> --- 25,32 ----
> #include "utils/memutils.h"
> #include "utils/rel.h"
>
> + /* GUC parameter */
> + int pending_list_cleanup_size = 0;
>
> I think we need to initialize the GUC to boot_val, 4096 in this case.

No, IIUC basically the variable for GUC doesn't need to be initialized
to its default value. OTOH, it's also harmless to initialize it to the default.
I like the current code a bit because we don't need to change the initial
value again when we decide to change the default value of GUC.
I have no strong opinion about this, though.

Regards,

--
Fujii Masao


From: Etsuro Fujita <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Jeff Janes <jeff(dot)janes(at)gmail(dot)com>, Sawada Masahiko <sawada(dot)mshk(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Robert Haas <robertmhaas(at)gmail(dot)com>, Jesper Krogh <jesper(at)krogh(dot)cc>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: PENDING_LIST_CLEANUP_SIZE - maximum size of GIN pending list Re: HEAD seems to generate larger WAL regarding GIN index
Date: 2014-11-11 10:01:04
Message-ID: 5461DE60.30106@lab.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

(2014/11/11 2:31), Fujii Masao wrote:
> On Mon, Nov 10, 2014 at 4:15 PM, Etsuro Fujita
>> The patch looks good to me except for the following point:

>> *** a/src/backend/access/gin/ginfast.c
>> --- b/src/backend/access/gin/ginfast.c
>> ***************
>> *** 25,30 ****
>> --- 25,32 ----
>> #include "utils/memutils.h"
>> #include "utils/rel.h"
>>
>> + /* GUC parameter */
>> + int pending_list_cleanup_size = 0;
>>
>> I think we need to initialize the GUC to boot_val, 4096 in this case.
>
> No, IIUC basically the variable for GUC doesn't need to be initialized
> to its default value. OTOH, it's also harmless to initialize it to the default.
> I like the current code a bit because we don't need to change the initial
> value again when we decide to change the default value of GUC.
> I have no strong opinion about this, though.

OK, so if there are no objections of others, I'll mark this as "Ready
for Committer".

Thanks,

Best regards,
Etsuro Fujita


From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Etsuro Fujita <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp>
Cc: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Jeff Janes <jeff(dot)janes(at)gmail(dot)com>, Sawada Masahiko <sawada(dot)mshk(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Robert Haas <robertmhaas(at)gmail(dot)com>, Jesper Krogh <jesper(at)krogh(dot)cc>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: PENDING_LIST_CLEANUP_SIZE - maximum size of GIN pending list Re: HEAD seems to generate larger WAL regarding GIN index
Date: 2014-11-11 12:11:54
Message-ID: CAHGQGwF1whOmOh8cZhQx+fTzgVY7zUYWS9BaVvXjc346B1=OwQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Tue, Nov 11, 2014 at 7:01 PM, Etsuro Fujita
<fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp> wrote:
> (2014/11/11 2:31), Fujii Masao wrote:
>>
>> On Mon, Nov 10, 2014 at 4:15 PM, Etsuro Fujita
>>>
>>> The patch looks good to me except for the following point:
>
>
>>> *** a/src/backend/access/gin/ginfast.c
>>> --- b/src/backend/access/gin/ginfast.c
>>> ***************
>>> *** 25,30 ****
>>> --- 25,32 ----
>>> #include "utils/memutils.h"
>>> #include "utils/rel.h"
>>>
>>> + /* GUC parameter */
>>> + int pending_list_cleanup_size = 0;
>>>
>>> I think we need to initialize the GUC to boot_val, 4096 in this case.
>>
>>
>> No, IIUC basically the variable for GUC doesn't need to be initialized
>> to its default value. OTOH, it's also harmless to initialize it to the
>> default.
>> I like the current code a bit because we don't need to change the initial
>> value again when we decide to change the default value of GUC.
>> I have no strong opinion about this, though.
>
>
> OK, so if there are no objections of others, I'll mark this as "Ready for
> Committer".

I just pushed this. Thanks!

Regards,

--
Fujii Masao


From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: Etsuro Fujita <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Jeff Janes <jeff(dot)janes(at)gmail(dot)com>, Sawada Masahiko <sawada(dot)mshk(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Jesper Krogh <jesper(at)krogh(dot)cc>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: PENDING_LIST_CLEANUP_SIZE - maximum size of GIN pending list Re: HEAD seems to generate larger WAL regarding GIN index
Date: 2014-11-11 13:14:20
Message-ID: CA+TgmoZJsxLK5YFsxMt6menAHDMHq+LieoLzT3zcX7MyYJxOSw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Tue, Nov 11, 2014 at 7:11 AM, Fujii Masao <masao(dot)fujii(at)gmail(dot)com> wrote:
>> OK, so if there are no objections of others, I'll mark this as "Ready for
>> Committer".
>
> I just pushed this. Thanks!

Not to kibitz too much after-the-fact, but wouldn't it be better to
give this a name that has "GIN" in it somewhere?

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


From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Etsuro Fujita <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Jeff Janes <jeff(dot)janes(at)gmail(dot)com>, Sawada Masahiko <sawada(dot)mshk(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Jesper Krogh <jesper(at)krogh(dot)cc>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: PENDING_LIST_CLEANUP_SIZE - maximum size of GIN pending list Re: HEAD seems to generate larger WAL regarding GIN index
Date: 2014-11-11 14:32:53
Message-ID: CAHGQGwGS=rszC4WYVPNOiXRXLaBvdtp-LgnBCSj14C+ToNv1mA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Tue, Nov 11, 2014 at 10:14 PM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> On Tue, Nov 11, 2014 at 7:11 AM, Fujii Masao <masao(dot)fujii(at)gmail(dot)com> wrote:
>>> OK, so if there are no objections of others, I'll mark this as "Ready for
>>> Committer".
>>
>> I just pushed this. Thanks!
>
> Not to kibitz too much after-the-fact, but wouldn't it be better to
> give this a name that has "GIN" in it somewhere?

Maybe. gin_pending_list_cleanup_size? gin_pending_list_limit? Better name?

Regards,

--
Fujii Masao


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Etsuro Fujita <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Jeff Janes <jeff(dot)janes(at)gmail(dot)com>, Sawada Masahiko <sawada(dot)mshk(at)gmail(dot)com>, Jesper Krogh <jesper(at)krogh(dot)cc>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: PENDING_LIST_CLEANUP_SIZE - maximum size of GIN pending list Re: HEAD seems to generate larger WAL regarding GIN index
Date: 2014-11-11 15:40:32
Message-ID: 24403.1415720432@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Fujii Masao <masao(dot)fujii(at)gmail(dot)com> writes:
> On Tue, Nov 11, 2014 at 10:14 PM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
>> Not to kibitz too much after-the-fact, but wouldn't it be better to
>> give this a name that has "GIN" in it somewhere?

> Maybe. gin_pending_list_cleanup_size? gin_pending_list_limit? Better name?

gin_pending_list_limit sounds good to me.

regards, tom lane


From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Etsuro Fujita <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Jeff Janes <jeff(dot)janes(at)gmail(dot)com>, Sawada Masahiko <sawada(dot)mshk(at)gmail(dot)com>, Jesper Krogh <jesper(at)krogh(dot)cc>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: PENDING_LIST_CLEANUP_SIZE - maximum size of GIN pending list Re: HEAD seems to generate larger WAL regarding GIN index
Date: 2014-11-12 12:30:21
Message-ID: CAHGQGwFL7uzSxap7j9+ZgZyJyrDh5OnQSXgiX_oE9bqc_B_dOg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Wed, Nov 12, 2014 at 12:40 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Fujii Masao <masao(dot)fujii(at)gmail(dot)com> writes:
>> On Tue, Nov 11, 2014 at 10:14 PM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
>>> Not to kibitz too much after-the-fact, but wouldn't it be better to
>>> give this a name that has "GIN" in it somewhere?
>
>> Maybe. gin_pending_list_cleanup_size? gin_pending_list_limit? Better name?
>
> gin_pending_list_limit sounds good to me.

OK, barring any objection, I will rename the reloption and GUC to
gin_pending_list_limit.

Regards,

--
Fujii Masao


From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Etsuro Fujita <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Jeff Janes <jeff(dot)janes(at)gmail(dot)com>, Sawada Masahiko <sawada(dot)mshk(at)gmail(dot)com>, Jesper Krogh <jesper(at)krogh(dot)cc>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: PENDING_LIST_CLEANUP_SIZE - maximum size of GIN pending list Re: HEAD seems to generate larger WAL regarding GIN index
Date: 2014-11-13 03:15:40
Message-ID: CAHGQGwFvpEsSG0ijn3UzOiN_nEisvMjvHUwW4QWt3cbW42LbPw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Wed, Nov 12, 2014 at 9:30 PM, Fujii Masao <masao(dot)fujii(at)gmail(dot)com> wrote:
> On Wed, Nov 12, 2014 at 12:40 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> Fujii Masao <masao(dot)fujii(at)gmail(dot)com> writes:
>>> On Tue, Nov 11, 2014 at 10:14 PM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
>>>> Not to kibitz too much after-the-fact, but wouldn't it be better to
>>>> give this a name that has "GIN" in it somewhere?
>>
>>> Maybe. gin_pending_list_cleanup_size? gin_pending_list_limit? Better name?
>>
>> gin_pending_list_limit sounds good to me.
>
> OK, barring any objection, I will rename the reloption and GUC to
> gin_pending_list_limit.

Done.

Regards,

--
Fujii Masao


From: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: Etsuro Fujita <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Sawada Masahiko <sawada(dot)mshk(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Robert Haas <robertmhaas(at)gmail(dot)com>, Jesper Krogh <jesper(at)krogh(dot)cc>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: PENDING_LIST_CLEANUP_SIZE - maximum size of GIN pending list Re: HEAD seems to generate larger WAL regarding GIN index
Date: 2015-08-10 17:58:33
Message-ID: CAMkU=1y-G_y9vGW+qRpS-Jp-pfT8TixxzfxnHNqKq+6jh-W48g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Thu, Oct 30, 2014 at 5:30 AM, Fujii Masao <masao(dot)fujii(at)gmail(dot)com> wrote:

> On Thu, Oct 30, 2014 at 7:30 PM, Etsuro Fujita
> <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp> wrote:
>
> > + {
> > + {"pending_list_cleanup_size", PGC_USERSET,
> > CLIENT_CONN_STATEMENT,
> > + gettext_noop("Sets the maximum size of the
> pending
> > list for GIN index."),
> > + NULL,
> > + GUC_UNIT_KB
> > + },
> > + &pending_list_cleanup_size,
> > + 4096, 0, MAX_KILOBYTES,
> > + NULL, NULL, NULL
> > + },
> >
> > ISTM it'd be better to use RESOURCES_MEM, not CLIENT_CONN_STATEMENT. No?
>
> Yes if the pending list always exists in the memory. But not, IIUC.
> Thought?
>
> > Also why not set min to 64, not to 0, in accoradance with that of
> work_mem?
>
> I'm OK to use 64. But I just chose 0 because I could not think of any
> reasonable
> reason why 64k is suitable as the minimum size of the pending list.
> IOW, I have no idea about whether it's reasonable to use the min value of
> work_mem as the min size of the pending list.
>

I know I am late to the party here, but would like to have the minimum be
0, not 64. As long as by zero, it means it doesn't insert anything into
the pending list, rather than inserting and promptly cleaning it up.

The reason for this is that if I am trying to decide what
pending_list_cleanup_size I want to set for the index in the indexes
storage parameters, the way to find that out is try a bunch of different
ones through the guc while the index is still at the default of no
overriding storage parameter. It would be nice to try the fastupdate=off
alternative (i.e. the same as pending_list_cleanup_size=0) without having
to change the index itself and change the syntax used in the testing.

Cheers,

Jeff


From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
Cc: Etsuro Fujita <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Sawada Masahiko <sawada(dot)mshk(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Robert Haas <robertmhaas(at)gmail(dot)com>, Jesper Krogh <jesper(at)krogh(dot)cc>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: PENDING_LIST_CLEANUP_SIZE - maximum size of GIN pending list Re: HEAD seems to generate larger WAL regarding GIN index
Date: 2015-09-02 10:44:25
Message-ID: CAHGQGwErWssBhyxaU5ft-fEJ4BF1WJ801GtTS_OGKpJZ3Jp_RQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Tue, Aug 11, 2015 at 2:58 AM, Jeff Janes <jeff(dot)janes(at)gmail(dot)com> wrote:
> On Thu, Oct 30, 2014 at 5:30 AM, Fujii Masao <masao(dot)fujii(at)gmail(dot)com> wrote:
>>
>> On Thu, Oct 30, 2014 at 7:30 PM, Etsuro Fujita
>> <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp> wrote:
>>
>> > + {
>> > + {"pending_list_cleanup_size", PGC_USERSET,
>> > CLIENT_CONN_STATEMENT,
>> > + gettext_noop("Sets the maximum size of the
>> > pending
>> > list for GIN index."),
>> > + NULL,
>> > + GUC_UNIT_KB
>> > + },
>> > + &pending_list_cleanup_size,
>> > + 4096, 0, MAX_KILOBYTES,
>> > + NULL, NULL, NULL
>> > + },
>> >
>> > ISTM it'd be better to use RESOURCES_MEM, not CLIENT_CONN_STATEMENT. No?
>>
>> Yes if the pending list always exists in the memory. But not, IIUC.
>> Thought?
>>
>> > Also why not set min to 64, not to 0, in accoradance with that of
>> > work_mem?
>>
>> I'm OK to use 64. But I just chose 0 because I could not think of any
>> reasonable
>> reason why 64k is suitable as the minimum size of the pending list.
>> IOW, I have no idea about whether it's reasonable to use the min value of
>> work_mem as the min size of the pending list.
>
>
>
> I know I am late to the party here, but would like to have the minimum be 0,
> not 64. As long as by zero, it means it doesn't insert anything into the
> pending list, rather than inserting and promptly cleaning it up.
>
> The reason for this is that if I am trying to decide what
> pending_list_cleanup_size I want to set for the index in the indexes storage
> parameters, the way to find that out is try a bunch of different ones
> through the guc while the index is still at the default of no overriding
> storage parameter. It would be nice to try the fastupdate=off alternative
> (i.e. the same as pending_list_cleanup_size=0) without having to change the
> index itself and change the syntax used in the testing.

Sounds OK to me. So we should change the minimum values of both
gin_pending_list_limit GUC and storage parameters to 0? Or only GUC?

Regards,

--
Fujii Masao