mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-10-01 14:11:31 +02:00
Remove no-longer-needed compatibility code for hash indexes.
Because commit ea69a0dead
bumped the
HASH_VERSION, we don't need to worry about PostgreSQL 10 seeing
bucket pages from earlier versions.
Amit Kapila
Discussion: http://postgr.es/m/CAA4eK1LAo4DGwh+mi-G3U8Pj1WkBBeFL38xdCnUHJv1z4bZFkQ@mail.gmail.com
This commit is contained in:
parent
df1a4eba94
commit
a5775991bb
@ -624,13 +624,9 @@ loop_top:
|
|||||||
* now that the primary page of the target bucket has been locked
|
* now that the primary page of the target bucket has been locked
|
||||||
* (and thus can't be further split), check whether we need to
|
* (and thus can't be further split), check whether we need to
|
||||||
* update our cached metapage data.
|
* update our cached metapage data.
|
||||||
*
|
|
||||||
* NB: The check for InvalidBlockNumber is only needed for
|
|
||||||
* on-disk compatibility with indexes created before we started
|
|
||||||
* storing hashm_maxbucket in the primary page's hasho_prevblkno.
|
|
||||||
*/
|
*/
|
||||||
if (bucket_opaque->hasho_prevblkno != InvalidBlockNumber &&
|
Assert(bucket_opaque->hasho_prevblkno != InvalidBlockNumber);
|
||||||
bucket_opaque->hasho_prevblkno > cachedmetap->hashm_maxbucket)
|
if (bucket_opaque->hasho_prevblkno > cachedmetap->hashm_maxbucket)
|
||||||
{
|
{
|
||||||
cachedmetap = _hash_getcachedmetap(rel, &metabuf, true);
|
cachedmetap = _hash_getcachedmetap(rel, &metabuf, true);
|
||||||
Assert(cachedmetap != NULL);
|
Assert(cachedmetap != NULL);
|
||||||
|
@ -1564,16 +1564,12 @@ _hash_getbucketbuf_from_hashkey(Relation rel, uint32 hashkey, int access,
|
|||||||
page = BufferGetPage(buf);
|
page = BufferGetPage(buf);
|
||||||
opaque = (HashPageOpaque) PageGetSpecialPointer(page);
|
opaque = (HashPageOpaque) PageGetSpecialPointer(page);
|
||||||
Assert(opaque->hasho_bucket == bucket);
|
Assert(opaque->hasho_bucket == bucket);
|
||||||
|
Assert(opaque->hasho_prevblkno != InvalidBlockNumber);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If this bucket hasn't been split, we're done.
|
* If this bucket hasn't been split, we're done.
|
||||||
*
|
|
||||||
* NB: The check for InvalidBlockNumber is only needed for on-disk
|
|
||||||
* compatibility with indexes created before we started storing
|
|
||||||
* hashm_maxbucket in the primary page's hasho_prevblkno.
|
|
||||||
*/
|
*/
|
||||||
if (opaque->hasho_prevblkno == InvalidBlockNumber ||
|
if (opaque->hasho_prevblkno <= metap->hashm_maxbucket)
|
||||||
opaque->hasho_prevblkno <= metap->hashm_maxbucket)
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* Drop lock on this buffer, update cached metapage, and retry. */
|
/* Drop lock on this buffer, update cached metapage, and retry. */
|
||||||
|
Loading…
Reference in New Issue
Block a user