Re: Write Ahead Logging for Hash Indexes
Robert Haas <robertmhaas@gmail.com>
From: Robert Haas <robertmhaas@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Amit Kapila <amit.kapila16@gmail.com>,
Jesper Pedersen <jesper.pedersen@redhat.com>, Jeff Janes <jeff.janes@gmail.com>,
pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2017-03-14T17:58:51Z
Lists: pgsql-hackers
On Tue, Mar 14, 2017 at 1:40 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote: > Robert Haas <robertmhaas@gmail.com> writes: >> Great! I've committed the latest version of the patch, with some >> cosmetic changes. > > Woo hoo! That's been a bee in the bonnet for, um, decades. Yeah. I'm pretty happy to see that go in. It's become pretty clear to me that there are a bunch of other things about hash indexes which are not exactly great, the worst of which is the way they grow by DOUBLING IN SIZE. Mithun has submitted a patch which - if it's acceptable - would alleviate that to some degree by splitting up each doubling into four separate increments. But that still could lead to very large growth increments on big indexes, like your 32GB index suddenly growing - in one fell swoop - to 40GB. That's admittedly a lot better than what will happen right now, which is instantaneous growth to 64GB, but it's not great, and it's not altogether clear how it could be fixed in a really satisfying way. Other things that are not so great: - no multi-column support - no amcanunique support - every insert dirties the metapage - splitting is generally too aggressive; very few overflow pages are ever created unless you have piles of duplicates Still, this is a big step forward. I think it will be useful for people with long text strings or other very wide data that they want to index, and hopefully we'll get some feedback from users about where this works well and where it doesn't. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company
Commits
-
Add a regression test for snapshot too old with hash indexes.
- 42bdaebf1618 10.0 landed
-
hash: Add write-ahead logging support.
- c11453ce0aea 10.0 landed
-
Improve coding in _hash_addovflpage.
- e898437460f5 10.0 cited
-
Remove _hash_wrtbuf() in favor of calling MarkBufferDirty().
- 25216c989384 10.0 cited
-
Improve hash index bucket split behavior.
- 6d46f4783efe 10.0 cited