PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
hash.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * hash.h
4  * header file for postgres hash access method implementation
5  *
6  *
7  * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
8  * Portions Copyright (c) 1994, Regents of the University of California
9  *
10  * src/include/access/hash.h
11  *
12  * NOTES
13  * modeled after Margo Seltzer's hash implementation for unix.
14  *
15  *-------------------------------------------------------------------------
16  */
17 #ifndef HASH_H
18 #define HASH_H
19 
20 #include "access/amapi.h"
21 #include "access/itup.h"
22 #include "access/sdir.h"
23 #include "fmgr.h"
24 #include "lib/stringinfo.h"
25 #include "storage/bufmgr.h"
26 #include "storage/lockdefs.h"
27 #include "utils/hsearch.h"
28 #include "utils/relcache.h"
29 
30 /*
31  * Mapping from hash bucket number to physical block number of bucket's
32  * starting page. Beware of multiple evaluations of argument!
33  */
34 typedef uint32 Bucket;
35 
36 #define InvalidBucket ((Bucket) 0xFFFFFFFF)
37 
38 #define BUCKET_TO_BLKNO(metap,B) \
39  ((BlockNumber) ((B) + ((B) ? (metap)->hashm_spares[_hash_log2((B)+1)-1] : 0)) + 1)
40 
41 /*
42  * Special space for hash index pages.
43  *
44  * hasho_flag tells us which type of page we're looking at. For
45  * example, knowing overflow pages from bucket pages is necessary
46  * information when you're deleting tuples from a page. If all the
47  * tuples are deleted from an overflow page, the overflow is made
48  * available to other buckets by calling _hash_freeovflpage(). If all
49  * the tuples are deleted from a bucket page, no additional action is
50  * necessary.
51  */
52 #define LH_UNUSED_PAGE (0)
53 #define LH_OVERFLOW_PAGE (1 << 0)
54 #define LH_BUCKET_PAGE (1 << 1)
55 #define LH_BITMAP_PAGE (1 << 2)
56 #define LH_META_PAGE (1 << 3)
57 #define LH_BUCKET_BEING_POPULATED (1 << 4)
58 #define LH_BUCKET_BEING_SPLIT (1 << 5)
59 #define LH_BUCKET_NEEDS_SPLIT_CLEANUP (1 << 6)
60 
61 #define LH_PAGE_TYPE \
62  (LH_OVERFLOW_PAGE|LH_BUCKET_PAGE|LH_BITMAP_PAGE|LH_META_PAGE)
63 
64 /*
65  * In an overflow page, hasho_prevblkno stores the block number of the previous
66  * page in the bucket chain; in a bucket page, hasho_prevblkno stores the
67  * hashm_maxbucket value as of the last time the bucket was last split, or
68  * else as of the time the bucket was created. The latter convention is used
69  * to determine whether a cached copy of the metapage is too stale to be used
70  * without needing to lock or pin the metapage.
71  *
72  * hasho_nextblkno is always the block number of the next page in the
73  * bucket chain, or InvalidBlockNumber if there are no more such pages.
74  */
75 typedef struct HashPageOpaqueData
76 {
77  BlockNumber hasho_prevblkno; /* see above */
78  BlockNumber hasho_nextblkno; /* see above */
79  Bucket hasho_bucket; /* bucket number this pg belongs to */
80  uint16 hasho_flag; /* page type code, see above */
81  uint16 hasho_page_id; /* for identification of hash indexes */
83 
85 
86 #define H_NEEDS_SPLIT_CLEANUP(opaque) ((opaque)->hasho_flag & LH_BUCKET_NEEDS_SPLIT_CLEANUP)
87 #define H_BUCKET_BEING_SPLIT(opaque) ((opaque)->hasho_flag & LH_BUCKET_BEING_SPLIT)
88 #define H_BUCKET_BEING_POPULATED(opaque) ((opaque)->hasho_flag & LH_BUCKET_BEING_POPULATED)
89 
90 /*
91  * The page ID is for the convenience of pg_filedump and similar utilities,
92  * which otherwise would have a hard time telling pages of different index
93  * types apart. It should be the last 2 bytes on the page. This is more or
94  * less "free" due to alignment considerations.
95  */
96 #define HASHO_PAGE_ID 0xFF80
97 
98 /*
99  * HashScanOpaqueData is private state for a hash index scan.
100  */
101 typedef struct HashScanOpaqueData
102 {
103  /* Hash value of the scan key, ie, the hash key we seek */
105 
106  /*
107  * We also want to remember which buffer we're currently examining in the
108  * scan. We keep the buffer pinned (but not locked) across hashgettuple
109  * calls, in order to avoid doing a ReadBuffer() for every tuple in the
110  * index.
111  */
113 
114  /* remember the buffer associated with primary bucket */
116 
117  /*
118  * remember the buffer associated with primary bucket page of bucket being
119  * split. it is required during the scan of the bucket which is being
120  * populated during split operation.
121  */
123 
124  /* Current position of the scan, as an index TID */
126 
127  /* Current position of the scan, as a heap TID */
129 
130  /* Whether scan starts on bucket being populated due to split */
132 
133  /*
134  * Whether scanning bucket being split? The value of this parameter is
135  * referred only when hashso_buc_populated is true.
136  */
139 
141 
142 /*
143  * Definitions for metapage.
144  */
145 
146 #define HASH_METAPAGE 0 /* metapage is always block 0 */
147 
148 #define HASH_MAGIC 0x6440640
149 #define HASH_VERSION 2 /* 2 signifies only hash key value is stored */
150 
151 /*
152  * spares[] holds the number of overflow pages currently allocated at or
153  * before a certain splitpoint. For example, if spares[3] = 7 then there are
154  * 7 ovflpages before splitpoint 3 (compare BUCKET_TO_BLKNO macro). The
155  * value in spares[ovflpoint] increases as overflow pages are added at the
156  * end of the index. Once ovflpoint increases (ie, we have actually allocated
157  * the bucket pages belonging to that splitpoint) the number of spares at the
158  * prior splitpoint cannot change anymore.
159  *
160  * ovflpages that have been recycled for reuse can be found by looking at
161  * bitmaps that are stored within ovflpages dedicated for the purpose.
162  * The blknos of these bitmap pages are kept in mapp[]; nmaps is the
163  * number of currently existing bitmaps.
164  *
165  * The limitation on the size of spares[] comes from the fact that there's
166  * no point in having more than 2^32 buckets with only uint32 hashcodes.
167  * There is no particular upper limit on the size of mapp[], other than
168  * needing to fit into the metapage. (With 8K block size, 128 bitmaps
169  * limit us to 64 GB of overflow space...)
170  */
171 #define HASH_MAX_SPLITPOINTS 32
172 #define HASH_MAX_BITMAPS 128
173 
174 typedef struct HashMetaPageData
175 {
176  uint32 hashm_magic; /* magic no. for hash tables */
177  uint32 hashm_version; /* version ID */
178  double hashm_ntuples; /* number of tuples stored in the table */
179  uint16 hashm_ffactor; /* target fill factor (tuples/bucket) */
180  uint16 hashm_bsize; /* index page size (bytes) */
181  uint16 hashm_bmsize; /* bitmap array size (bytes) - must be a power
182  * of 2 */
183  uint16 hashm_bmshift; /* log2(bitmap array size in BITS) */
184  uint32 hashm_maxbucket; /* ID of maximum bucket in use */
185  uint32 hashm_highmask; /* mask to modulo into entire table */
186  uint32 hashm_lowmask; /* mask to modulo into lower half of table */
187  uint32 hashm_ovflpoint;/* splitpoint from which ovflpgs being
188  * allocated */
189  uint32 hashm_firstfree; /* lowest-number free ovflpage (bit#) */
190  uint32 hashm_nmaps; /* number of bitmap pages */
191  RegProcedure hashm_procid; /* hash procedure id from pg_proc */
192  uint32 hashm_spares[HASH_MAX_SPLITPOINTS]; /* spare pages before
193  * each splitpoint */
194  BlockNumber hashm_mapp[HASH_MAX_BITMAPS]; /* blknos of ovfl bitmaps */
196 
198 
199 /*
200  * Maximum size of a hash index item (it's okay to have only one per page)
201  */
202 #define HashMaxItemSize(page) \
203  MAXALIGN_DOWN(PageGetPageSize(page) - \
204  SizeOfPageHeaderData - \
205  sizeof(ItemIdData) - \
206  MAXALIGN(sizeof(HashPageOpaqueData)))
207 
208 #define INDEX_MOVED_BY_SPLIT_MASK 0x2000
209 
210 #define HASH_MIN_FILLFACTOR 10
211 #define HASH_DEFAULT_FILLFACTOR 75
212 
213 /*
214  * Constants
215  */
216 #define BYTE_TO_BIT 3 /* 2^3 bits/byte */
217 #define ALL_SET ((uint32) ~0)
218 
219 /*
220  * Bitmap pages do not contain tuples. They do contain the standard
221  * page headers and trailers; however, everything in between is a
222  * giant bit array. The number of bits that fit on a page obviously
223  * depends on the page size and the header/trailer overhead. We require
224  * the number of bits per page to be a power of 2.
225  */
226 #define BMPGSZ_BYTE(metap) ((metap)->hashm_bmsize)
227 #define BMPGSZ_BIT(metap) ((metap)->hashm_bmsize << BYTE_TO_BIT)
228 #define BMPG_SHIFT(metap) ((metap)->hashm_bmshift)
229 #define BMPG_MASK(metap) (BMPGSZ_BIT(metap) - 1)
230 
231 #define HashPageGetBitmap(page) \
232  ((uint32 *) PageGetContents(page))
233 
234 #define HashGetMaxBitmapSize(page) \
235  (PageGetPageSize((Page) page) - \
236  (MAXALIGN(SizeOfPageHeaderData) + MAXALIGN(sizeof(HashPageOpaqueData))))
237 
238 #define HashPageGetMeta(page) \
239  ((HashMetaPage) PageGetContents(page))
240 
241 /*
242  * The number of bits in an ovflpage bitmap word.
243  */
244 #define BITS_PER_MAP 32 /* Number of bits in uint32 */
245 
246 /* Given the address of the beginning of a bit map, clear/set the nth bit */
247 #define CLRBIT(A, N) ((A)[(N)/BITS_PER_MAP] &= ~(1<<((N)%BITS_PER_MAP)))
248 #define SETBIT(A, N) ((A)[(N)/BITS_PER_MAP] |= (1<<((N)%BITS_PER_MAP)))
249 #define ISSET(A, N) ((A)[(N)/BITS_PER_MAP] & (1<<((N)%BITS_PER_MAP)))
250 
251 /*
252  * page-level and high-level locking modes (see README)
253  */
254 #define HASH_READ BUFFER_LOCK_SHARE
255 #define HASH_WRITE BUFFER_LOCK_EXCLUSIVE
256 #define HASH_NOLOCK (-1)
257 
258 /*
259  * Strategy number. There's only one valid strategy for hashing: equality.
260  */
261 #define HTEqualStrategyNumber 1
262 #define HTMaxStrategyNumber 1
263 
264 /*
265  * When a new operator class is declared, we require that the user supply
266  * us with an amproc procudure for hashing a key of the new type.
267  * Since we only have one such proc in amproc, it's number 1.
268  */
269 #define HASHPROC 1
270 #define HASHNProcs 1
271 
272 
273 /* public routines */
274 
276  struct IndexInfo *indexInfo);
277 extern void hashbuildempty(Relation index);
278 extern bool hashinsert(Relation rel, Datum *values, bool *isnull,
279  ItemPointer ht_ctid, Relation heapRel,
280  IndexUniqueCheck checkUnique,
281  struct IndexInfo *indexInfo);
282 extern bool hashgettuple(IndexScanDesc scan, ScanDirection dir);
283 extern int64 hashgetbitmap(IndexScanDesc scan, TIDBitmap *tbm);
284 extern IndexScanDesc hashbeginscan(Relation rel, int nkeys, int norderbys);
285 extern void hashrescan(IndexScanDesc scan, ScanKey scankey, int nscankeys,
286  ScanKey orderbys, int norderbys);
287 extern void hashendscan(IndexScanDesc scan);
289  IndexBulkDeleteResult *stats,
291  void *callback_state);
293  IndexBulkDeleteResult *stats);
294 extern bytea *hashoptions(Datum reloptions, bool validate);
295 extern bool hashvalidate(Oid opclassoid);
296 
297 extern Datum hash_any(register const unsigned char *k, register int keylen);
298 extern Datum hash_uint32(uint32 k);
299 
300 /* private routines */
301 
302 /* hashinsert.c */
303 extern void _hash_doinsert(Relation rel, IndexTuple itup);
305  Size itemsize, IndexTuple itup);
306 
307 /* hashovfl.c */
308 extern Buffer _hash_addovflpage(Relation rel, Buffer metabuf, Buffer buf, bool retain_pin);
309 extern BlockNumber _hash_freeovflpage(Relation rel, Buffer ovflbuf, Buffer wbuf,
310  BufferAccessStrategy bstrategy);
311 extern void _hash_initbitmap(Relation rel, HashMetaPage metap,
312  BlockNumber blkno, ForkNumber forkNum);
313 extern void _hash_squeezebucket(Relation rel,
314  Bucket bucket, BlockNumber bucket_blkno,
315  Buffer bucket_buf,
316  BufferAccessStrategy bstrategy);
318 
319 /* hashpage.c */
320 extern Buffer _hash_getbuf(Relation rel, BlockNumber blkno,
321  int access, int flags);
323  BlockNumber blkno, int flags);
324 extern HashMetaPage _hash_getcachedmetap(Relation rel, Buffer *metabuf,
325  bool force_refresh);
327  int access,
328  HashMetaPage *cachedmetap);
329 extern Buffer _hash_getinitbuf(Relation rel, BlockNumber blkno);
330 extern Buffer _hash_getnewbuf(Relation rel, BlockNumber blkno,
331  ForkNumber forkNum);
333  int access, int flags,
334  BufferAccessStrategy bstrategy);
335 extern void _hash_relbuf(Relation rel, Buffer buf);
336 extern void _hash_dropbuf(Relation rel, Buffer buf);
337 extern void _hash_dropscanbuf(Relation rel, HashScanOpaque so);
338 extern uint32 _hash_metapinit(Relation rel, double num_tuples,
339  ForkNumber forkNum);
340 extern void _hash_pageinit(Page page, Size size);
341 extern void _hash_expandtable(Relation rel, Buffer metabuf);
342 extern void _hash_finish_split(Relation rel, Buffer metabuf, Buffer obuf,
343  Bucket obucket, uint32 maxbucket, uint32 highmask,
344  uint32 lowmask);
345 
346 /* hashsearch.c */
347 extern bool _hash_next(IndexScanDesc scan, ScanDirection dir);
348 extern bool _hash_first(IndexScanDesc scan, ScanDirection dir);
349 extern bool _hash_step(IndexScanDesc scan, Buffer *bufP, ScanDirection dir);
350 
351 /* hashsort.c */
352 typedef struct HSpool HSpool; /* opaque struct in hashsort.c */
353 
354 extern HSpool *_h_spoolinit(Relation heap, Relation index, uint32 num_buckets);
355 extern void _h_spooldestroy(HSpool *hspool);
356 extern void _h_spool(HSpool *hspool, ItemPointer self,
357  Datum *values, bool *isnull);
358 extern void _h_indexbuild(HSpool *hspool);
359 
360 /* hashutil.c */
361 extern bool _hash_checkqual(IndexScanDesc scan, IndexTuple itup);
362 extern uint32 _hash_datum2hashkey(Relation rel, Datum key);
363 extern uint32 _hash_datum2hashkey_type(Relation rel, Datum key, Oid keytype);
364 extern Bucket _hash_hashkey2bucket(uint32 hashkey, uint32 maxbucket,
365  uint32 highmask, uint32 lowmask);
366 extern uint32 _hash_log2(uint32 num);
367 extern void _hash_checkpage(Relation rel, Buffer buf, int flags);
370  Datum *user_values, bool *user_isnull,
371  Datum *index_values, bool *index_isnull);
372 extern OffsetNumber _hash_binsearch(Page page, uint32 hash_value);
373 extern OffsetNumber _hash_binsearch_last(Page page, uint32 hash_value);
377  uint32 lowmask, uint32 maxbucket);
378 
379 /* hash.c */
380 extern void hashbucketcleanup(Relation rel, Bucket cur_bucket,
381  Buffer bucket_buf, BlockNumber bucket_blkno,
382  BufferAccessStrategy bstrategy,
383  uint32 maxbucket, uint32 highmask, uint32 lowmask,
384  double *tuples_removed, double *num_index_tuples,
385  bool bucket_has_garbage,
386  IndexBulkDeleteCallback callback, void *callback_state);
387 
388 #endif /* HASH_H */
bool _hash_convert_tuple(Relation index, Datum *user_values, bool *user_isnull, Datum *index_values, bool *index_isnull)
Definition: hashutil.c:259
void hashendscan(IndexScanDesc scan)
Definition: hash.c:480
HashScanOpaqueData * HashScanOpaque
Definition: hash.h:140
uint16 hashm_bmshift
Definition: hash.h:183
uint16 hasho_page_id
Definition: hash.h:81
IndexScanDesc hashbeginscan(Relation rel, int nkeys, int norderbys)
Definition: hash.c:422
void _hash_doinsert(Relation rel, IndexTuple itup)
Definition: hashinsert.c:29
Buffer _hash_getbuf(Relation rel, BlockNumber blkno, int access, int flags)
Definition: hashpage.c:79
RegProcedure hashm_procid
Definition: hash.h:191
void _hash_pageinit(Page page, Size size)
Definition: hashpage.c:471
void hashbucketcleanup(Relation rel, Bucket cur_bucket, Buffer bucket_buf, BlockNumber bucket_blkno, BufferAccessStrategy bstrategy, uint32 maxbucket, uint32 highmask, uint32 lowmask, double *tuples_removed, double *num_index_tuples, bool bucket_has_garbage, IndexBulkDeleteCallback callback, void *callback_state)
Definition: hash.c:711
bool hashvalidate(Oid opclassoid)
Definition: hashvalidate.c:44
uint32 _hash_log2(uint32 num)
Definition: hashutil.c:140
bytea * hashoptions(Datum reloptions, bool validate)
Definition: hashutil.c:223
int64 hashgetbitmap(IndexScanDesc scan, TIDBitmap *tbm)
Definition: hash.c:376
Buffer _hash_getbucketbuf_from_hashkey(Relation rel, uint32 hashkey, int access, HashMetaPage *cachedmetap)
Definition: hashpage.c:1274
bool _hash_checkqual(IndexScanDesc scan, IndexTuple itup)
Definition: hashutil.c:30
regproc RegProcedure
Definition: c.h:392
uint32 hashm_magic
Definition: hash.h:176
HashMetaPage _hash_getcachedmetap(Relation rel, Buffer *metabuf, bool force_refresh)
Definition: hashpage.c:1216
void hashrescan(IndexScanDesc scan, ScanKey scankey, int nscankeys, ScanKey orderbys, int norderbys)
Definition: hash.c:452
uint16 hashm_ffactor
Definition: hash.h:179
uint32 hashm_highmask
Definition: hash.h:185
HashMetaPageData * HashMetaPage
Definition: hash.h:197
IndexBuildResult * hashbuild(Relation heap, Relation index, struct IndexInfo *indexInfo)
Definition: hash.c:101
uint32 BlockNumber
Definition: block.h:31
unsigned int Oid
Definition: postgres_ext.h:31
bool hashgettuple(IndexScanDesc scan, ScanDirection dir)
Definition: hash.c:265
void _hash_squeezebucket(Relation rel, Bucket bucket, BlockNumber bucket_blkno, Buffer bucket_buf, BufferAccessStrategy bstrategy)
Definition: hashovfl.c:629
uint32 hashm_lowmask
Definition: hash.h:186
void _h_spool(HSpool *hspool, ItemPointer self, Datum *values, bool *isnull)
Definition: hashsort.c:93
void _hash_dropscanbuf(Relation rel, HashScanOpaque so)
Definition: hashpage.c:268
Buffer _hash_getinitbuf(Relation rel, BlockNumber blkno)
Definition: hashpage.c:144
bool hashinsert(Relation rel, Datum *values, bool *isnull, ItemPointer ht_ctid, Relation heapRel, IndexUniqueCheck checkUnique, struct IndexInfo *indexInfo)
Definition: hash.c:234
#define HASH_MAX_SPLITPOINTS
Definition: hash.h:171
bool _hash_step(IndexScanDesc scan, Buffer *bufP, ScanDirection dir)
Definition: hashsearch.c:387
uint32 _hash_datum2hashkey_type(Relation rel, Datum key, Oid keytype)
Definition: hashutil.c:101
uint16 OffsetNumber
Definition: off.h:24
Definition: type.h:90
uint32 Bucket
Definition: hash.h:34
IndexUniqueCheck
Definition: genam.h:111
bool _hash_next(IndexScanDesc scan, ScanDirection dir)
Definition: hashsearch.c:34
unsigned short uint16
Definition: c.h:264
void _hash_finish_split(Relation rel, Buffer metabuf, Buffer obuf, Bucket obucket, uint32 maxbucket, uint32 highmask, uint32 lowmask)
Definition: hashpage.c:1095
BlockNumber hasho_prevblkno
Definition: hash.h:77
void _h_indexbuild(HSpool *hspool)
Definition: hashsort.c:104
Buffer _hash_getnewbuf(Relation rel, BlockNumber blkno, ForkNumber forkNum)
Definition: hashpage.c:177
void _hash_checkpage(Relation rel, Buffer buf, int flags)
Definition: hashutil.c:158
static void callback(struct sockaddr *addr, struct sockaddr *mask, void *unused)
Definition: test_ifaddrs.c:49
uint32 hashm_version
Definition: hash.h:177
uint32 hashm_nmaps
Definition: hash.h:190
struct HashMetaPageData HashMetaPageData
Buffer _hash_addovflpage(Relation rel, Buffer metabuf, Buffer buf, bool retain_pin)
Definition: hashovfl.c:109
IndexBulkDeleteResult * hashvacuumcleanup(IndexVacuumInfo *info, IndexBulkDeleteResult *stats)
Definition: hash.c:671
static char * buf
Definition: pg_test_fsync.c:65
ScanDirection
Definition: sdir.h:22
OffsetNumber _hash_pgaddtup(Relation rel, Buffer buf, Size itemsize, IndexTuple itup)
Definition: hashinsert.c:211
unsigned int uint32
Definition: c.h:265
Buffer hashso_bucket_buf
Definition: hash.h:115
ForkNumber
Definition: relpath.h:24
void _hash_relbuf(Relation rel, Buffer buf)
Definition: hashpage.c:245
#define HASH_MAX_BITMAPS
Definition: hash.h:172
void _hash_expandtable(Relation rel, Buffer metabuf)
Definition: hashpage.c:490
bool _hash_first(IndexScanDesc scan, ScanDirection dir)
Definition: hashsearch.c:220
uint32 hashm_ovflpoint
Definition: hash.h:187
uint16 hashm_bsize
Definition: hash.h:180
BlockNumber _hash_get_newblock_from_oldbucket(Relation rel, Bucket old_bucket)
Definition: hashutil.c:402
void _hash_initbitmap(Relation rel, HashMetaPage metap, BlockNumber blkno, ForkNumber forkNum)
Definition: hashovfl.c:546
uintptr_t Datum
Definition: postgres.h:374
BlockNumber _hash_get_oldblock_from_newbucket(Relation rel, Bucket new_bucket)
Definition: hashutil.c:363
double hashm_ntuples
Definition: hash.h:178
bool hashso_buc_populated
Definition: hash.h:131
uint32 hashm_firstfree
Definition: hash.h:189
uint32 hashm_spares[HASH_MAX_SPLITPOINTS]
Definition: hash.h:192
uint32 hashso_sk_hash
Definition: hash.h:104
uint32 _hash_get_indextuple_hashkey(IndexTuple itup)
Definition: hashutil.c:232
BlockNumber _hash_freeovflpage(Relation rel, Buffer ovflbuf, Buffer wbuf, BufferAccessStrategy bstrategy)
Definition: hashovfl.c:406
Bucket _hash_get_newbucket_from_oldbucket(Relation rel, Bucket old_bucket, uint32 lowmask, uint32 maxbucket)
Definition: hashutil.c:435
void hashbuildempty(Relation index)
Definition: hash.c:183
void _h_spooldestroy(HSpool *hspool)
Definition: hashsort.c:83
Bucket hasho_bucket
Definition: hash.h:79
size_t Size
Definition: c.h:353
void _hash_dropbuf(Relation rel, Buffer buf)
Definition: hashpage.c:256
HashPageOpaqueData * HashPageOpaque
Definition: hash.h:84
OffsetNumber _hash_binsearch_last(Page page, uint32 hash_value)
Definition: hashutil.c:329
ItemPointerData hashso_curpos
Definition: hash.h:125
HSpool * _h_spoolinit(Relation heap, Relation index, uint32 num_buckets)
Definition: hashsort.c:48
Buffer _hash_getbuf_with_condlock_cleanup(Relation rel, BlockNumber blkno, int flags)
Definition: hashpage.c:105
struct HashScanOpaqueData HashScanOpaqueData
uint32 hashm_maxbucket
Definition: hash.h:184
uint32 _hash_metapinit(Relation rel, double num_tuples, ForkNumber forkNum)
Definition: hashpage.c:306
struct HashPageOpaqueData HashPageOpaqueData
uint16 hasho_flag
Definition: hash.h:80
bool hashso_buc_split
Definition: hash.h:137
static Datum values[MAXATTR]
Definition: bootstrap.c:162
Datum hash_any(register const unsigned char *k, register int keylen)
Definition: hashfunc.c:307
Bucket _hash_hashkey2bucket(uint32 hashkey, uint32 maxbucket, uint32 highmask, uint32 lowmask)
Definition: hashutil.c:124
Buffer hashso_split_bucket_buf
Definition: hash.h:122
Buffer _hash_getbuf_with_strategy(Relation rel, BlockNumber blkno, int access, int flags, BufferAccessStrategy bstrategy)
Definition: hashpage.c:218
BlockNumber hasho_nextblkno
Definition: hash.h:78
uint16 hashm_bmsize
Definition: hash.h:181
uint32 _hash_datum2hashkey(Relation rel, Datum key)
Definition: hashutil.c:81
Datum hash_uint32(uint32 k)
Definition: hashfunc.c:512
Definition: c.h:435
OffsetNumber _hash_binsearch(Page page, uint32 hash_value)
Definition: hashutil.c:291
uint32 _hash_ovflblkno_to_bitno(HashMetaPage metap, BlockNumber ovflblkno)
Definition: hashovfl.c:60
IndexBulkDeleteResult * hashbulkdelete(IndexVacuumInfo *info, IndexBulkDeleteResult *stats, IndexBulkDeleteCallback callback, void *callback_state)
Definition: hash.c:502
BlockNumber hashm_mapp[HASH_MAX_BITMAPS]
Definition: hash.h:194
int Buffer
Definition: buf.h:23
ItemPointerData hashso_heappos
Definition: hash.h:128
bool(* IndexBulkDeleteCallback)(ItemPointer itemptr, void *state)
Definition: genam.h:83
Buffer hashso_curbuf
Definition: hash.h:112
Pointer Page
Definition: bufpage.h:74