Re: GIN predicate locking slows down valgrind isolationtests tremendously

From: Alexander Korotkov <a(dot)korotkov(at)postgrespro(dot)ru>
To: Teodor Sigaev <teodor(at)sigaev(dot)ru>, Shubham Barai <shubhambaraiss(at)gmail(dot)com>, Dmitry Ivanov <d(dot)ivanov(at)postgrespro(dot)ru>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Andres Freund <andres(at)anarazel(dot)de>
Subject: Re: GIN predicate locking slows down valgrind isolationtests tremendously
Date: 2018-12-24 21:19:27
Message-ID: CAPpHfdv7rrDyy=MgsaK-L9kk0AH7az0B-mdC3w3p0FSb9uoyEg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Dec 21, 2018 at 1:50 AM Alexander Korotkov
<a(dot)korotkov(at)postgrespro(dot)ru> wrote:
> чт, 20 дек. 2018 г., 2:22 Andres Freund andres(at)anarazel(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Noah Misch 2018-12-24 22:16:01 Re: Race to build pg_isolation_regress in "make -j check-world"
Previous Message Mitar 2018-12-24 20:59:43 Feature: triggers on materialized views