PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
hashinsert.c File Reference
#include "postgres.h"
#include "access/hash.h"
#include "access/hash_xlog.h"
#include "access/heapam.h"
#include "miscadmin.h"
#include "utils/rel.h"
#include "storage/lwlock.h"
#include "storage/buf_internals.h"
Include dependency graph for hashinsert.c:

Go to the source code of this file.

Functions

static void _hash_vacuum_one_page (Relation rel, Buffer metabuf, Buffer buf, RelFileNode hnode)
 
void _hash_doinsert (Relation rel, IndexTuple itup, Relation heapRel)
 
OffsetNumber _hash_pgaddtup (Relation rel, Buffer buf, Size itemsize, IndexTuple itup)
 
void _hash_pgaddmultitup (Relation rel, Buffer buf, IndexTuple *itups, OffsetNumber *itup_offsets, uint16 nitups)
 

Function Documentation

void _hash_doinsert ( Relation  rel,
IndexTuple  itup,
Relation  heapRel 
)

Definition at line 36 of file hashinsert.c.

References _hash_addovflpage(), _hash_dropbuf(), _hash_expandtable(), _hash_finish_split(), _hash_get_indextuple_hashkey(), _hash_getbucketbuf_from_hashkey(), _hash_getbuf(), _hash_pgaddtup(), _hash_relbuf(), _hash_vacuum_one_page(), Assert, BlockNumberIsValid, buf, BUFFER_LOCK_EXCLUSIVE, BUFFER_LOCK_UNLOCK, BufferGetPage, END_CRIT_SECTION, ereport, errcode(), errhint(), errmsg(), ERROR, H_BUCKET_BEING_SPLIT, H_HAS_DEAD_TUPLES, HASH_METAPAGE, HASH_NOLOCK, HASH_WRITE, HashMetaPageData::hashm_ffactor, HashMetaPageData::hashm_highmask, HashMetaPageData::hashm_lowmask, HashMetaPageData::hashm_maxbucket, HashMetaPageData::hashm_ntuples, HashMaxItemSize, HashPageOpaqueData::hasho_bucket, HashPageOpaqueData::hasho_flag, HashPageOpaqueData::hasho_nextblkno, HashPageGetMeta, IndexTupleDSize, InvalidBuffer, IsBufferCleanupOK(), LH_META_PAGE, LH_OVERFLOW_PAGE, LH_PAGE_TYPE, LockBuffer(), MarkBufferDirty(), MAXALIGN, NULL, xl_hash_insert::offnum, PageGetFreeSpace(), PageGetSpecialPointer, PageSetLSN, RelationData::rd_node, REGBUF_STANDARD, RelationNeedsWAL, SizeOfHashInsert, START_CRIT_SECTION, XLOG_HASH_INSERT, XLogBeginInsert(), XLogInsert(), XLogRegisterBufData(), XLogRegisterBuffer(), and XLogRegisterData().

Referenced by _h_indexbuild(), hashbuildCallback(), and hashinsert().

37 {
39  Buffer bucket_buf;
40  Buffer metabuf;
41  HashMetaPage metap;
42  HashMetaPage usedmetap = NULL;
43  Page metapage;
44  Page page;
45  HashPageOpaque pageopaque;
46  Size itemsz;
47  bool do_expand;
48  uint32 hashkey;
49  Bucket bucket;
50  OffsetNumber itup_off;
51 
52  /*
53  * Get the hash key for the item (it's stored in the index tuple itself).
54  */
55  hashkey = _hash_get_indextuple_hashkey(itup);
56 
57  /* compute item size too */
58  itemsz = IndexTupleDSize(*itup);
59  itemsz = MAXALIGN(itemsz); /* be safe, PageAddItem will do this but we
60  * need to be consistent */
61 
62 restart_insert:
63 
64  /*
65  * Read the metapage. We don't lock it yet; HashMaxItemSize() will
66  * examine pd_pagesize_version, but that can't change so we can examine
67  * it without a lock.
68  */
70  metapage = BufferGetPage(metabuf);
71 
72  /*
73  * Check whether the item can fit on a hash page at all. (Eventually, we
74  * ought to try to apply TOAST methods if not.) Note that at this point,
75  * itemsz doesn't include the ItemId.
76  *
77  * XXX this is useless code if we are only storing hash keys.
78  */
79  if (itemsz > HashMaxItemSize(metapage))
80  ereport(ERROR,
81  (errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
82  errmsg("index row size %zu exceeds hash maximum %zu",
83  itemsz, HashMaxItemSize(metapage)),
84  errhint("Values larger than a buffer page cannot be indexed.")));
85 
86  /* Lock the primary bucket page for the target bucket. */
87  buf = _hash_getbucketbuf_from_hashkey(rel, hashkey, HASH_WRITE,
88  &usedmetap);
89  Assert(usedmetap != NULL);
90 
91  /* remember the primary bucket buffer to release the pin on it at end. */
92  bucket_buf = buf;
93 
94  page = BufferGetPage(buf);
95  pageopaque = (HashPageOpaque) PageGetSpecialPointer(page);
96  bucket = pageopaque->hasho_bucket;
97 
98  /*
99  * If this bucket is in the process of being split, try to finish the
100  * split before inserting, because that might create room for the
101  * insertion to proceed without allocating an additional overflow page.
102  * It's only interesting to finish the split if we're trying to insert
103  * into the bucket from which we're removing tuples (the "old" bucket),
104  * not if we're trying to insert into the bucket into which tuples are
105  * being moved (the "new" bucket).
106  */
107  if (H_BUCKET_BEING_SPLIT(pageopaque) && IsBufferCleanupOK(buf))
108  {
109  /* release the lock on bucket buffer, before completing the split. */
111 
112  _hash_finish_split(rel, metabuf, buf, bucket,
113  usedmetap->hashm_maxbucket,
114  usedmetap->hashm_highmask,
115  usedmetap->hashm_lowmask);
116 
117  /* release the pin on old and meta buffer. retry for insert. */
118  _hash_dropbuf(rel, buf);
119  _hash_dropbuf(rel, metabuf);
120  goto restart_insert;
121  }
122 
123  /* Do the insertion */
124  while (PageGetFreeSpace(page) < itemsz)
125  {
126  BlockNumber nextblkno;
127 
128  /*
129  * Check if current page has any DEAD tuples. If yes,
130  * delete these tuples and see if we can get a space for
131  * the new item to be inserted before moving to the next
132  * page in the bucket chain.
133  */
134  if (H_HAS_DEAD_TUPLES(pageopaque))
135  {
136 
137  if (IsBufferCleanupOK(buf))
138  {
139  _hash_vacuum_one_page(rel, metabuf, buf, heapRel->rd_node);
140 
141  if (PageGetFreeSpace(page) >= itemsz)
142  break; /* OK, now we have enough space */
143  }
144  }
145 
146  /*
147  * no space on this page; check for an overflow page
148  */
149  nextblkno = pageopaque->hasho_nextblkno;
150 
151  if (BlockNumberIsValid(nextblkno))
152  {
153  /*
154  * ovfl page exists; go get it. if it doesn't have room, we'll
155  * find out next pass through the loop test above. we always
156  * release both the lock and pin if this is an overflow page, but
157  * only the lock if this is the primary bucket page, since the pin
158  * on the primary bucket must be retained throughout the scan.
159  */
160  if (buf != bucket_buf)
161  _hash_relbuf(rel, buf);
162  else
164  buf = _hash_getbuf(rel, nextblkno, HASH_WRITE, LH_OVERFLOW_PAGE);
165  page = BufferGetPage(buf);
166  }
167  else
168  {
169  /*
170  * we're at the end of the bucket chain and we haven't found a
171  * page with enough room. allocate a new overflow page.
172  */
173 
174  /* release our write lock without modifying buffer */
176 
177  /* chain to a new overflow page */
178  buf = _hash_addovflpage(rel, metabuf, buf, (buf == bucket_buf) ? true : false);
179  page = BufferGetPage(buf);
180 
181  /* should fit now, given test above */
182  Assert(PageGetFreeSpace(page) >= itemsz);
183  }
184  pageopaque = (HashPageOpaque) PageGetSpecialPointer(page);
185  Assert((pageopaque->hasho_flag & LH_PAGE_TYPE) == LH_OVERFLOW_PAGE);
186  Assert(pageopaque->hasho_bucket == bucket);
187  }
188 
189  /*
190  * Write-lock the metapage so we can increment the tuple count. After
191  * incrementing it, check to see if it's time for a split.
192  */
194 
195  /* Do the update. No ereport(ERROR) until changes are logged */
197 
198  /* found page with enough space, so add the item here */
199  itup_off = _hash_pgaddtup(rel, buf, itemsz, itup);
200  MarkBufferDirty(buf);
201 
202  /* metapage operations */
203  metap = HashPageGetMeta(metapage);
204  metap->hashm_ntuples += 1;
205 
206  /* Make sure this stays in sync with _hash_expandtable() */
207  do_expand = metap->hashm_ntuples >
208  (double) metap->hashm_ffactor * (metap->hashm_maxbucket + 1);
209 
210  MarkBufferDirty(metabuf);
211 
212  /* XLOG stuff */
213  if (RelationNeedsWAL(rel))
214  {
215  xl_hash_insert xlrec;
216  XLogRecPtr recptr;
217 
218  xlrec.offnum = itup_off;
219 
220  XLogBeginInsert();
221  XLogRegisterData((char *) &xlrec, SizeOfHashInsert);
222 
223  XLogRegisterBuffer(1, metabuf, REGBUF_STANDARD);
224 
226  XLogRegisterBufData(0, (char *) itup, IndexTupleDSize(*itup));
227 
228  recptr = XLogInsert(RM_HASH_ID, XLOG_HASH_INSERT);
229 
230  PageSetLSN(BufferGetPage(buf), recptr);
231  PageSetLSN(BufferGetPage(metabuf), recptr);
232  }
233 
235 
236  /* drop lock on metapage, but keep pin */
237  LockBuffer(metabuf, BUFFER_LOCK_UNLOCK);
238 
239  /*
240  * Release the modified page and ensure to release the pin on primary
241  * page.
242  */
243  _hash_relbuf(rel, buf);
244  if (buf != bucket_buf)
245  _hash_dropbuf(rel, bucket_buf);
246 
247  /* Attempt to split if a split is needed */
248  if (do_expand)
249  _hash_expandtable(rel, metabuf);
250 
251  /* Finally drop our pin on the metapage */
252  _hash_dropbuf(rel, metabuf);
253 }
void XLogRegisterBufData(uint8 block_id, char *data, int len)
Definition: xloginsert.c:361
#define HashMaxItemSize(page)
Definition: hash.h:230
#define BUFFER_LOCK_UNLOCK
Definition: bufmgr.h:87
#define XLOG_HASH_INSERT
Definition: hash_xlog.h:29
int errhint(const char *fmt,...)
Definition: elog.c:987
#define LH_META_PAGE
Definition: hash.h:56
void MarkBufferDirty(Buffer buffer)
Definition: bufmgr.c:1450
void XLogRegisterBuffer(uint8 block_id, Buffer buffer, uint8 flags)
Definition: xloginsert.c:213
#define END_CRIT_SECTION()
Definition: miscadmin.h:132
uint16 hashm_ffactor
Definition: hash.h:207
uint32 hashm_highmask
Definition: hash.h:213
#define InvalidBuffer
Definition: buf.h:25
#define START_CRIT_SECTION()
Definition: miscadmin.h:130
int errcode(int sqlerrcode)
Definition: elog.c:575
Buffer _hash_getbucketbuf_from_hashkey(Relation rel, uint32 hashkey, int access, HashMetaPage *cachedmetap)
Definition: hashpage.c:1530
uint32 BlockNumber
Definition: block.h:31
void _hash_dropbuf(Relation rel, Buffer buf)
Definition: hashpage.c:285
Buffer _hash_getbuf(Relation rel, BlockNumber blkno, int access, int flags)
Definition: hashpage.c:78
#define BUFFER_LOCK_EXCLUSIVE
Definition: bufmgr.h:89
uint32 hashm_lowmask
Definition: hash.h:214
Size PageGetFreeSpace(Page page)
Definition: bufpage.c:582
uint16 OffsetNumber
Definition: off.h:24
#define LH_PAGE_TYPE
Definition: hash.h:62
uint32 Bucket
Definition: hash.h:34
#define SizeOfHashInsert
Definition: hash_xlog.h:81
#define ERROR
Definition: elog.h:43
uint32 _hash_get_indextuple_hashkey(IndexTuple itup)
Definition: hashutil.c:299
void _hash_finish_split(Relation rel, Buffer metabuf, Buffer obuf, Bucket obucket, uint32 maxbucket, uint32 highmask, uint32 lowmask)
Definition: hashpage.c:1325
#define IndexTupleDSize(itup)
Definition: itup.h:71
static char * buf
Definition: pg_test_fsync.c:66
#define HASH_WRITE
Definition: hash.h:283
#define HASH_NOLOCK
Definition: hash.h:284
#define REGBUF_STANDARD
Definition: xloginsert.h:35
unsigned int uint32
Definition: c.h:268
void _hash_expandtable(Relation rel, Buffer metabuf)
Definition: hashpage.c:615
#define BufferGetPage(buffer)
Definition: bufmgr.h:160
#define ereport(elevel, rest)
Definition: elog.h:122
bool IsBufferCleanupOK(Buffer buffer)
Definition: bufmgr.c:3774
void XLogRegisterData(char *data, int len)
Definition: xloginsert.c:323
XLogRecPtr XLogInsert(RmgrId rmid, uint8 info)
Definition: xloginsert.c:415
#define HASH_METAPAGE
Definition: hash.h:158
double hashm_ntuples
Definition: hash.h:206
#define LH_OVERFLOW_PAGE
Definition: hash.h:53
void LockBuffer(Buffer buffer, int mode)
Definition: bufmgr.c:3546
void _hash_relbuf(Relation rel, Buffer buf)
Definition: hashpage.c:274
#define BlockNumberIsValid(blockNumber)
Definition: block.h:70
#define H_BUCKET_BEING_SPLIT(opaque)
Definition: hash.h:88
RelFileNode rd_node
Definition: rel.h:85
#define NULL
Definition: c.h:229
uint64 XLogRecPtr
Definition: xlogdefs.h:21
#define Assert(condition)
Definition: c.h:675
Bucket hasho_bucket
Definition: hash.h:80
size_t Size
Definition: c.h:356
#define PageGetSpecialPointer(page)
Definition: bufpage.h:323
HashPageOpaqueData * HashPageOpaque
Definition: hash.h:85
OffsetNumber offnum
Definition: hash_xlog.h:78
Buffer _hash_addovflpage(Relation rel, Buffer metabuf, Buffer buf, bool retain_pin)
Definition: hashovfl.c:111
#define MAXALIGN(LEN)
Definition: c.h:588
#define RelationNeedsWAL(relation)
Definition: rel.h:506
uint32 hashm_maxbucket
Definition: hash.h:212
OffsetNumber _hash_pgaddtup(Relation rel, Buffer buf, Size itemsize, IndexTuple itup)
Definition: hashinsert.c:267
static void _hash_vacuum_one_page(Relation rel, Buffer metabuf, Buffer buf, RelFileNode hnode)
Definition: hashinsert.c:337
uint16 hasho_flag
Definition: hash.h:81
#define HashPageGetMeta(page)
Definition: hash.h:266
int errmsg(const char *fmt,...)
Definition: elog.c:797
BlockNumber hasho_nextblkno
Definition: hash.h:79
void XLogBeginInsert(void)
Definition: xloginsert.c:120
#define PageSetLSN(page, lsn)
Definition: bufpage.h:365
int Buffer
Definition: buf.h:23
#define H_HAS_DEAD_TUPLES(opaque)
Definition: hash.h:90
Pointer Page
Definition: bufpage.h:74
void _hash_pgaddmultitup ( Relation  rel,
Buffer  buf,
IndexTuple itups,
OffsetNumber itup_offsets,
uint16  nitups 
)

Definition at line 298 of file hashinsert.c.

References _hash_binsearch(), _hash_checkpage(), _hash_get_indextuple_hashkey(), BufferGetPage, elog, ERROR, i, IndexTupleDSize, InvalidOffsetNumber, LH_BUCKET_PAGE, LH_OVERFLOW_PAGE, MAXALIGN, PageAddItem, and RelationGetRelationName.

Referenced by _hash_freeovflpage(), _hash_splitbucket(), and _hash_squeezebucket().

300 {
301  OffsetNumber itup_off;
302  Page page;
303  uint32 hashkey;
304  int i;
305 
307  page = BufferGetPage(buf);
308 
309  for (i = 0; i < nitups; i++)
310  {
311  Size itemsize;
312 
313  itemsize = IndexTupleDSize(*itups[i]);
314  itemsize = MAXALIGN(itemsize);
315 
316  /* Find where to insert the tuple (preserving page's hashkey ordering) */
317  hashkey = _hash_get_indextuple_hashkey(itups[i]);
318  itup_off = _hash_binsearch(page, hashkey);
319 
320  itup_offsets[i] = itup_off;
321 
322  if (PageAddItem(page, (Item) itups[i], itemsize, itup_off, false, false)
324  elog(ERROR, "failed to add index item to \"%s\"",
326  }
327 }
Pointer Item
Definition: item.h:17
#define PageAddItem(page, item, size, offsetNumber, overwrite, is_heap)
Definition: bufpage.h:413
uint16 OffsetNumber
Definition: off.h:24
#define ERROR
Definition: elog.h:43
uint32 _hash_get_indextuple_hashkey(IndexTuple itup)
Definition: hashutil.c:299
#define IndexTupleDSize(itup)
Definition: itup.h:71
static char * buf
Definition: pg_test_fsync.c:66
#define RelationGetRelationName(relation)
Definition: rel.h:437
unsigned int uint32
Definition: c.h:268
#define BufferGetPage(buffer)
Definition: bufmgr.h:160
void _hash_checkpage(Relation rel, Buffer buf, int flags)
Definition: hashutil.c:225
#define LH_OVERFLOW_PAGE
Definition: hash.h:53
#define InvalidOffsetNumber
Definition: off.h:26
OffsetNumber _hash_binsearch(Page page, uint32 hash_value)
Definition: hashutil.c:358
#define LH_BUCKET_PAGE
Definition: hash.h:54
size_t Size
Definition: c.h:356
#define MAXALIGN(LEN)
Definition: c.h:588
int i
#define elog
Definition: elog.h:219
Pointer Page
Definition: bufpage.h:74
OffsetNumber _hash_pgaddtup ( Relation  rel,
Buffer  buf,
Size  itemsize,
IndexTuple  itup 
)

Definition at line 267 of file hashinsert.c.

References _hash_binsearch(), _hash_checkpage(), _hash_get_indextuple_hashkey(), BufferGetPage, elog, ERROR, InvalidOffsetNumber, LH_BUCKET_PAGE, LH_OVERFLOW_PAGE, PageAddItem, and RelationGetRelationName.

Referenced by _hash_doinsert().

268 {
269  OffsetNumber itup_off;
270  Page page;
271  uint32 hashkey;
272 
274  page = BufferGetPage(buf);
275 
276  /* Find where to insert the tuple (preserving page's hashkey ordering) */
277  hashkey = _hash_get_indextuple_hashkey(itup);
278  itup_off = _hash_binsearch(page, hashkey);
279 
280  if (PageAddItem(page, (Item) itup, itemsize, itup_off, false, false)
282  elog(ERROR, "failed to add index item to \"%s\"",
284 
285  return itup_off;
286 }
Pointer Item
Definition: item.h:17
#define PageAddItem(page, item, size, offsetNumber, overwrite, is_heap)
Definition: bufpage.h:413
uint16 OffsetNumber
Definition: off.h:24
#define ERROR
Definition: elog.h:43
uint32 _hash_get_indextuple_hashkey(IndexTuple itup)
Definition: hashutil.c:299
static char * buf
Definition: pg_test_fsync.c:66
#define RelationGetRelationName(relation)
Definition: rel.h:437
unsigned int uint32
Definition: c.h:268
#define BufferGetPage(buffer)
Definition: bufmgr.h:160
void _hash_checkpage(Relation rel, Buffer buf, int flags)
Definition: hashutil.c:225
#define LH_OVERFLOW_PAGE
Definition: hash.h:53
#define InvalidOffsetNumber
Definition: off.h:26
OffsetNumber _hash_binsearch(Page page, uint32 hash_value)
Definition: hashutil.c:358
#define LH_BUCKET_PAGE
Definition: hash.h:54
#define elog
Definition: elog.h:219
Pointer Page
Definition: bufpage.h:74
static void _hash_vacuum_one_page ( Relation  rel,
Buffer  metabuf,
Buffer  buf,
RelFileNode  hnode 
)
static

Definition at line 337 of file hashinsert.c.

References BUFFER_LOCK_EXCLUSIVE, BUFFER_LOCK_UNLOCK, BufferGetPage, END_CRIT_SECTION, FirstOffsetNumber, HashMetaPageData::hashm_ntuples, HashPageOpaqueData::hasho_flag, HashPageGetMeta, xl_hash_vacuum_one_page::hnode, ItemIdIsDead, LH_PAGE_HAS_DEAD_TUPLES, LockBuffer(), MarkBufferDirty(), MaxOffsetNumber, xl_hash_vacuum_one_page::ntuples, OffsetNumberNext, PageGetItemId, PageGetMaxOffsetNumber, PageGetSpecialPointer, PageIndexMultiDelete(), PageSetLSN, REGBUF_STANDARD, RelationNeedsWAL, SizeOfHashVacuumOnePage, START_CRIT_SECTION, XLOG_HASH_VACUUM_ONE_PAGE, XLogBeginInsert(), XLogInsert(), XLogRegisterBuffer(), and XLogRegisterData().

Referenced by _hash_doinsert().

339 {
340  OffsetNumber deletable[MaxOffsetNumber];
341  int ndeletable = 0;
342  OffsetNumber offnum,
343  maxoff;
344  Page page = BufferGetPage(buf);
345  HashPageOpaque pageopaque;
346  HashMetaPage metap;
347 
348  /* Scan each tuple in page to see if it is marked as LP_DEAD */
349  maxoff = PageGetMaxOffsetNumber(page);
350  for (offnum = FirstOffsetNumber;
351  offnum <= maxoff;
352  offnum = OffsetNumberNext(offnum))
353  {
354  ItemId itemId = PageGetItemId(page, offnum);
355 
356  if (ItemIdIsDead(itemId))
357  deletable[ndeletable++] = offnum;
358  }
359 
360  if (ndeletable > 0)
361  {
362  /*
363  * Write-lock the meta page so that we can decrement
364  * tuple count.
365  */
367 
368  /* No ereport(ERROR) until changes are logged */
370 
371  PageIndexMultiDelete(page, deletable, ndeletable);
372 
373  /*
374  * Mark the page as not containing any LP_DEAD items. This is not
375  * certainly true (there might be some that have recently been marked,
376  * but weren't included in our target-item list), but it will almost
377  * always be true and it doesn't seem worth an additional page scan
378  * to check it. Remember that LH_PAGE_HAS_DEAD_TUPLES is only a hint
379  * anyway.
380  */
381  pageopaque = (HashPageOpaque) PageGetSpecialPointer(page);
382  pageopaque->hasho_flag &= ~LH_PAGE_HAS_DEAD_TUPLES;
383 
384  metap = HashPageGetMeta(BufferGetPage(metabuf));
385  metap->hashm_ntuples -= ndeletable;
386 
388  MarkBufferDirty(metabuf);
389 
390  /* XLOG stuff */
391  if (RelationNeedsWAL(rel))
392  {
394  XLogRecPtr recptr;
395 
396  xlrec.hnode = hnode;
397  xlrec.ntuples = ndeletable;
398 
399  XLogBeginInsert();
401  XLogRegisterData((char *) &xlrec, SizeOfHashVacuumOnePage);
402 
403  /*
404  * We need the target-offsets array whether or not we store the whole
405  * buffer, to allow us to find the latestRemovedXid on a standby
406  * server.
407  */
408  XLogRegisterData((char *) deletable,
409  ndeletable * sizeof(OffsetNumber));
410 
411  XLogRegisterBuffer(1, metabuf, REGBUF_STANDARD);
412 
413  recptr = XLogInsert(RM_HASH_ID, XLOG_HASH_VACUUM_ONE_PAGE);
414 
415  PageSetLSN(BufferGetPage(buf), recptr);
416  PageSetLSN(BufferGetPage(metabuf), recptr);
417  }
418 
420  /*
421  * Releasing write lock on meta page as we have updated
422  * the tuple count.
423  */
424  LockBuffer(metabuf, BUFFER_LOCK_UNLOCK);
425  }
426 }
#define BUFFER_LOCK_UNLOCK
Definition: bufmgr.h:87
void MarkBufferDirty(Buffer buffer)
Definition: bufmgr.c:1450
void XLogRegisterBuffer(uint8 block_id, Buffer buffer, uint8 flags)
Definition: xloginsert.c:213
#define MaxOffsetNumber
Definition: off.h:28
#define END_CRIT_SECTION()
Definition: miscadmin.h:132
#define START_CRIT_SECTION()
Definition: miscadmin.h:130
#define BUFFER_LOCK_EXCLUSIVE
Definition: bufmgr.h:89
#define ItemIdIsDead(itemId)
Definition: itemid.h:112
#define PageGetMaxOffsetNumber(page)
Definition: bufpage.h:354
uint16 OffsetNumber
Definition: off.h:24
static char * buf
Definition: pg_test_fsync.c:66
#define FirstOffsetNumber
Definition: off.h:27
#define REGBUF_STANDARD
Definition: xloginsert.h:35
#define BufferGetPage(buffer)
Definition: bufmgr.h:160
#define PageGetItemId(page, offsetNumber)
Definition: bufpage.h:232
void XLogRegisterData(char *data, int len)
Definition: xloginsert.c:323
XLogRecPtr XLogInsert(RmgrId rmid, uint8 info)
Definition: xloginsert.c:415
#define SizeOfHashVacuumOnePage
Definition: hash_xlog.h:273
double hashm_ntuples
Definition: hash.h:206
void LockBuffer(Buffer buffer, int mode)
Definition: bufmgr.c:3546
#define XLOG_HASH_VACUUM_ONE_PAGE
Definition: hash_xlog.h:47
uint64 XLogRecPtr
Definition: xlogdefs.h:21
void PageIndexMultiDelete(Page page, OffsetNumber *itemnos, int nitems)
Definition: bufpage.c:836
#define OffsetNumberNext(offsetNumber)
Definition: off.h:53
#define PageGetSpecialPointer(page)
Definition: bufpage.h:323
HashPageOpaqueData * HashPageOpaque
Definition: hash.h:85
#define RelationNeedsWAL(relation)
Definition: rel.h:506
uint16 hasho_flag
Definition: hash.h:81
#define HashPageGetMeta(page)
Definition: hash.h:266
void XLogBeginInsert(void)
Definition: xloginsert.c:120
#define PageSetLSN(page, lsn)
Definition: bufpage.h:365
#define LH_PAGE_HAS_DEAD_TUPLES
Definition: hash.h:60
Pointer Page
Definition: bufpage.h:74