Re: GIN fast insert

From: Teodor Sigaev <teodor(at)sigaev(dot)ru>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: GIN fast insert
Date: 2009-03-24 15:39:21
Message-ID: 49C8FEA9.7090506@sigaev.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> ginInsertCleanup(); is it accurate? (If it isn't, I think

Exactly, that is right.

>
>
> * This can be called concurrently by multiple backends, so it must cope.
> * On first glance it looks completely not concurrent-safe and not crash-safe
> * either. The reason it's okay is that multiple insertion of the same entry
> * is detected and treated as a no-op by gininsert.c. If we crash after
> * posting entries to the main index and before removing them from the
> * pending list, it's okay because when we redo the posting later on, nothing
> * bad will happen. Likewise, if two backends simultaneously try to post
> * a pending entry into the main index, one will succeed and one will do
> * nothing. We try to notice when someone else is a little bit ahead of
> * us in the process, but that's just to avoid wasting cycles. Only the
> * action of removing a page from the pending list really needs exclusive
> * lock.
>
>
> regards, tom lane
>

--
Teodor Sigaev E-mail: teodor(at)sigaev(dot)ru
WWW: http://www.sigaev.ru/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ben Ali Rachid 2009-03-24 16:54:30 Function C and INOUT parameters
Previous Message Tom Lane 2009-03-24 15:19:30 Re: GIN fast insert