diff options
| author | Tom Lane <tgl@sss.pgh.pa.us> | 2003-09-02 02:18:38 +0000 |
|---|---|---|
| committer | Tom Lane <tgl@sss.pgh.pa.us> | 2003-09-02 02:18:38 +0000 |
| commit | 39673ca47b862f7bf82c9e3dca64ee9bbafc64ee (patch) | |
| tree | 75bb1c4e44fb7cc5a79c989289544d6f60e4d426 /src/include/access/hash.h | |
| parent | 5f65345a5711db5067664b08fb810b1a388b485d (diff) | |
| download | postgresql-39673ca47b862f7bf82c9e3dca64ee9bbafc64ee.tar.gz | |
Rewrite hashbulkdelete() to make it amenable to new bucket locking
scheme. A pleasant side effect is that it is *much* faster when deleting
a large fraction of the indexed tuples, because of elimination of
redundant hash_step activity induced by hash_adjscans. Various other
continuing code cleanup.
Diffstat (limited to 'src/include/access/hash.h')
| -rw-r--r-- | src/include/access/hash.h | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/include/access/hash.h b/src/include/access/hash.h index 83aae20c1c..045fb40c40 100644 --- a/src/include/access/hash.h +++ b/src/include/access/hash.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: hash.h,v 1.50 2003/09/01 20:26:34 tgl Exp $ + * $Id: hash.h,v 1.51 2003/09/02 02:18:38 tgl Exp $ * * NOTES * modeled after Margo Seltzer's hash implementation for unix. @@ -25,13 +25,12 @@ /* * Mapping from hash bucket number to physical block number of bucket's - * starting page. Beware of multiple evaluations of argument! Also notice - * macro's implicit dependency on "metap". + * starting page. Beware of multiple evaluations of argument! */ typedef uint32 Bucket; -#define BUCKET_TO_BLKNO(B) \ - ((BlockNumber) ((B) + ((B) ? metap->hashm_spares[_hash_log2((B)+1)-1] : 0)) + 1) +#define BUCKET_TO_BLKNO(metap,B) \ + ((BlockNumber) ((B) + ((B) ? (metap)->hashm_spares[_hash_log2((B)+1)-1] : 0)) + 1) /* * Special space for hash index pages. @@ -243,8 +242,8 @@ extern Buffer _hash_addovflpage(Relation rel, Buffer metabuf, Buffer buf); extern BlockNumber _hash_freeovflpage(Relation rel, Buffer ovflbuf); extern void _hash_initbitmap(Relation rel, HashMetaPage metap, BlockNumber blkno); -extern void _hash_squeezebucket(Relation rel, HashMetaPage metap, - Bucket bucket); +extern void _hash_squeezebucket(Relation rel, + Bucket bucket, BlockNumber bucket_blkno); /* hashpage.c */ extern void _hash_metapinit(Relation rel); |
