BRIN indexes (was Re: Minmax indexes)
Alvaro Herrera <alvherre@2ndquadrant.com>
From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Heikki Linnakangas <hlinnakangas@vmware.com>
Cc: Simon Riggs <simon@2ndquadrant.com>, Robert Haas <robertmhaas@gmail.com>,
Nicolas Barbier <nicolas.barbier@gmail.com>,
Claudio Freire <klaussfreire@gmail.com>, Josh Berkus <josh@agliodbs.com>,
Andres Freund <andres@2ndquadrant.com>,
Pg Hackers <pgsql-hackers@postgresql.org>
Date: 2014-09-08T16:02:20Z
Lists: pgsql-hackers
Attachments
- minmax-18.patch (text/x-diff) patch
Here's version 18. I have renamed it: These are now BRIN indexes. I have fixed numerous race conditions and deadlocks. In particular I fixed this problem you noted: Heikki Linnakangas wrote: > Another race condition: > > If a new tuple is inserted to the range while summarization runs, > it's possible that the new tuple isn't included in the tuple that > the summarization calculated, nor does the insertion itself udpate > it. I did it mostly in the way you outlined, i.e. by way of a placeholder tuple that gets updated by concurrent inserters and then the tuple resulting from the scan is unioned with the values in the updated placeholder tuple. This required the introduction of one extra support proc for opclasses (pretty simple stuff anyhow). There should be only minor items left now, such as silencing the WARNING: concurrent insert in progress within table "sales" which is emitted by IndexBuildHeapScan (possibly thousands of times) when doing a summarization of a range being inserted into or otherwise modified. Basically the issue here is that IBHS assumes it's being run with ShareLock in the heap (which blocks inserts), but here we're using it with ShareUpdateExclusive only, which lets inserts in. There is no harm AFAICS because of the placeholder tuple stuff I describe above. -- Álvaro Herrera http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services
Commits
-
Refactor per-page logic common to all redo routines to a new function.
- f8f4227976a2 9.5.0 cited
-
Reduce use of heavyweight locking inside hash AM.
- 76837c1507cb 9.3.0 cited
-
Scan the buffer pool just once, not once per fork, during relation drop.
- ece01aae4792 9.2.0 cited
-
Major patch from Thomas Lockhart <Thomas.G.Lockhart@jpl.nasa.gov>
- 9e2a87b62db8 7.1.1 cited