Re: Bitmap Indexes patch (was Re: Bitmap Indexes: request for feedback)

From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: Greg Stark <stark(at)enterprisedb(dot)com>
Cc: Gianni Ciolli <gianni(dot)ciolli(at)2ndquadrant(dot)it>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Gabriele Bartolini <gabriele(dot)bartolini(at)2ndquadrant(dot)it>
Subject: Re: Bitmap Indexes patch (was Re: Bitmap Indexes: request for feedback)
Date: 2008-11-03 23:39:45
Message-ID: 1225755585.3971.1014.camel@ebony.2ndQuadrant
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On Mon, 2008-11-03 at 23:28 +0000, Simon Riggs wrote:
> On Mon, 2008-11-03 at 17:37 -0500, Greg Stark wrote:
>
> > Secondly the locking seems to be a bit overoptimistic. I'm pretty sure
> > you have to take an exclusive lock on an index page any time you make
> > any data modifications in index pages -- even if you're just setting a
> > bit and not moving any data around. If two processes set two bits in
> > the same word one can get lost in the race condition.
>
> I looked at that aspect of the patch specifically a few weeks back while
> checking for possible issues with Hot Standby. IIRC the patch is fairly
> careful with locking and uses Exclusive locks extensively throughout. I
> looked at both the theory and the implementation. Unless Gianni changed
> something in that regard recently, I don't understand that comment at
> all. Probably need to provide specific examples of your concerns.

Just went through patch and checked all occurrences of BM_READ. I don't
see any out of place: there's only 11 calls that use it. Note that there
are multiple data structures in the index, just like GIN, so you need to
look at which structure is being locked for each operation.

--
Simon Riggs www.2ndQuadrant.com
PostgreSQL Training, Services and Support

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Vladimir Sitnikov 2008-11-03 23:53:28 Re: Bitmap Indexes patch (was Re: Bitmap Indexes: request for feedback)
Previous Message imad 2008-11-03 23:30:33 Re: Get Date value from Datum