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

Commit65c2d42

Browse files
committed
Preliminary cleanup for hash index code (doesn't attack the locking problem
yet). Fix a couple of bugs that would only appear if multiple bitmap pagesare used, including a buffer reference leak and incorrect computation of bitindexes. Get rid of 'overflow address' concept, which accomplished nothingexcept obfuscating the code and creating a risk of failure due to limitedrange of offset field. Rename some misleadingly-named fields and routines,and improve documentation.
1 parenteaeb862 commit65c2d42

File tree

4 files changed

+364
-450
lines changed

4 files changed

+364
-450
lines changed

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

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashinsert.c,v 1.27 2003/08/04 02:39:57 momjian Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashinsert.c,v 1.28 2003/09/01 20:26:34 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -155,7 +155,7 @@ _hash_insertonpg(Relation rel,
155155
* page with enough room. allocate a new overflow page.
156156
*/
157157
do_expand= true;
158-
ovflbuf=_hash_addovflpage(rel,&metabuf,buf);
158+
ovflbuf=_hash_addovflpage(rel,metabuf,buf);
159159
_hash_relbuf(rel,buf,HASH_WRITE);
160160
buf=ovflbuf;
161161
page=BufferGetPage(buf);
@@ -186,18 +186,15 @@ _hash_insertonpg(Relation rel,
186186
* access type just for a moment to allow greater accessibility to
187187
* the metapage.
188188
*/
189-
metap= (HashMetaPage)_hash_chgbufaccess(rel,&metabuf,
190-
HASH_READ,HASH_WRITE);
191-
metap->hashm_nkeys+=1;
192-
metap= (HashMetaPage)_hash_chgbufaccess(rel,&metabuf,
193-
HASH_WRITE,HASH_READ);
194-
189+
_hash_chgbufaccess(rel,metabuf,HASH_READ,HASH_WRITE);
190+
metap->hashm_ntuples+=1;
191+
_hash_chgbufaccess(rel,metabuf,HASH_WRITE,HASH_READ);
195192
}
196193

197194
_hash_wrtbuf(rel,buf);
198195

199196
if (do_expand||
200-
(metap->hashm_nkeys / (metap->hashm_maxbucket+1))
197+
(metap->hashm_ntuples / (metap->hashm_maxbucket+1))
201198
>metap->hashm_ffactor)
202199
_hash_expandtable(rel,metabuf);
203200
_hash_relbuf(rel,metabuf,HASH_READ);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp