Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita577599

Browse files
committed
Remove no-longer-needed compatibility code for hash indexes.
Because commitea69a0d bumped theHASH_VERSION, we don't need to worry about PostgreSQL 10 seeingbucket pages from earlier versions.Amit KapilaDiscussion:http://postgr.es/m/CAA4eK1LAo4DGwh+mi-G3U8Pj1WkBBeFL38xdCnUHJv1z4bZFkQ@mail.gmail.com
1 parentdf1a4eb commita577599

File tree

2 files changed

+4
-12
lines changed

2 files changed

+4
-12
lines changed

‎src/backend/access/hash/hash.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -624,13 +624,9 @@ hashbulkdelete(IndexVacuumInfo *info, IndexBulkDeleteResult *stats,
624624
* now that the primary page of the target bucket has been locked
625625
* (and thus can't be further split), check whether we need to
626626
* update our cached metapage data.
627-
*
628-
* NB: The check for InvalidBlockNumber is only needed for
629-
* on-disk compatibility with indexes created before we started
630-
* storing hashm_maxbucket in the primary page's hasho_prevblkno.
631627
*/
632-
if(bucket_opaque->hasho_prevblkno!=InvalidBlockNumber&&
633-
bucket_opaque->hasho_prevblkno>cachedmetap->hashm_maxbucket)
628+
Assert(bucket_opaque->hasho_prevblkno!=InvalidBlockNumber);
629+
if (bucket_opaque->hasho_prevblkno>cachedmetap->hashm_maxbucket)
634630
{
635631
cachedmetap=_hash_getcachedmetap(rel,&metabuf, true);
636632
Assert(cachedmetap!=NULL);

‎src/backend/access/hash/hashpage.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1564,16 +1564,12 @@ _hash_getbucketbuf_from_hashkey(Relation rel, uint32 hashkey, int access,
15641564
page=BufferGetPage(buf);
15651565
opaque= (HashPageOpaque)PageGetSpecialPointer(page);
15661566
Assert(opaque->hasho_bucket==bucket);
1567+
Assert(opaque->hasho_prevblkno!=InvalidBlockNumber);
15671568

15681569
/*
15691570
* If this bucket hasn't been split, we're done.
1570-
*
1571-
* NB: The check for InvalidBlockNumber is only needed for on-disk
1572-
* compatibility with indexes created before we started storing
1573-
* hashm_maxbucket in the primary page's hasho_prevblkno.
15741571
*/
1575-
if (opaque->hasho_prevblkno==InvalidBlockNumber||
1576-
opaque->hasho_prevblkno <=metap->hashm_maxbucket)
1572+
if (opaque->hasho_prevblkno <=metap->hashm_maxbucket)
15771573
break;
15781574

15791575
/* Drop lock on this buffer, update cached metapage, and retry. */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp