Re: Hash Indexes
Robert Haas <robertmhaas@gmail.com>
From: Robert Haas <robertmhaas@gmail.com>
To: Amit Kapila <amit.kapila16@gmail.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2016-06-23T17:26:37Z
Lists: pgsql-hackers
On Wed, Jun 22, 2016 at 10:13 PM, Amit Kapila <amit.kapila16@gmail.com> wrote: >> A scan that has seen the flag won't look at the >> tuple in any case. > > Why so? Assume that scan started on new bucket where > split-in-progress flag was set, now it will not look at tuples that > are marked as moved-by-split in this bucket, as it will assume to find > all such tuples in old bucket. Now, if allow Vacuum or someone else > to remove tuples from old with just an Exclusive lock, it is quite > possible that scan miss the tuple in old bucket which got removed by > vacuum. Oh, you're right. So we really need to CLEAR the split-in-progress flag before removing any tuples from the old bucket. Does that sound right? -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company
Commits
-
Remove _hash_wrtbuf() in favor of calling MarkBufferDirty().
- 25216c989384 10.0 landed
-
Fix race introduced by 6d46f4783efe457f74816a75173eb23ed8930020.
- 2f4193c3509a 10.0 cited
-
Improve hash index bucket split behavior.
- 6d46f4783efe 10.0 landed
-
Reduce pinning and buffer content locking for btree scans.
- 2ed5b87f96d4 9.5.0 cited