Re: GIN predicate locking slows down valgrind isolationtests tremendously - Mailing list pgsql-hackers

From Alexander Korotkov
Subject Re: GIN predicate locking slows down valgrind isolationtests tremendously
Date
Msg-id CAPpHfdv7rrDyy=MgsaK-L9kk0AH7az0B-mdC3w3p0FSb9uoyEg@mail.gmail.com
Whole thread Raw
In response to Re: GIN predicate locking slows down valgrind isolationtests tremendously  (Alexander Korotkov <a.korotkov@postgrespro.ru>)
Responses Re: GIN predicate locking slows down valgrind isolationtests tremendously  (Alexander Korotkov <a.korotkov@postgrespro.ru>)
List pgsql-hackers
On Fri, Dec 21, 2018 at 1:50 AM Alexander Korotkov
<a.korotkov@postgrespro.ru> wrote:
> чт, 20 дек. 2018 г., 2:22 Andres Freund andres@anarazel.de:
>> On 2018-12-03 16:07:40 -0800, Andres Freund wrote:
>> > As far as I can tell that increase comes laregely from the new GIN
>> > tests.  Could one of you please look at keeping the test time increase
>> > to something more reasonable?
>>
>> Ping?
>>
>> It's also one of the slowest tests outside of valgrind...
>
> I'm going to take a look on that.

While trying to reduce isolation test suite for GIN, I found following
behavior surprising for me.

GinBtreeStack *
ginFindLeafPage(GinBtree btree, bool searchMode, Snapshot snapshot)
{
    GinBtreeStack *stack;

    stack = (GinBtreeStack *) palloc(sizeof(GinBtreeStack));
    stack->blkno = btree->rootBlkno;
    stack->buffer = ReadBuffer(btree->index, btree->rootBlkno);
    stack->parent = NULL;
    stack->predictNumber = 1;

    if (!searchMode)
        CheckForSerializableConflictIn(btree->index, NULL, stack->buffer);

So, we're checking for conflict on tree root for every entry insert.
That's right for posting tree, but completely unneeded for entry tree.
I'm intended to change that to lock root of only posting tree if
nobody explains me why I'm wrong...

------
Alexander Korotkov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company


pgsql-hackers by date:

Previous
From: Mitar
Date:
Subject: Feature: triggers on materialized views
Next
From: Noah Misch
Date:
Subject: Re: Race to build pg_isolation_regress in "make -j check-world"