PostgreSQL Source Code  git master
tidstore.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * tidstore.h
4  * TidStore interface.
5  *
6  *
7  * Portions Copyright (c) 1996-2024, PostgreSQL Global Development Group
8  * Portions Copyright (c) 1994, Regents of the University of California
9  *
10  * src/include/access/tidstore.h
11  *
12  *-------------------------------------------------------------------------
13  */
14 #ifndef TIDSTORE_H
15 #define TIDSTORE_H
16 
17 #include "storage/itemptr.h"
18 #include "utils/dsa.h"
19 
20 typedef struct TidStore TidStore;
21 typedef struct TidStoreIter TidStoreIter;
22 
23 /*
24  * Result struct for TidStoreIterateNext. This is copyable, but should be
25  * treated as opaque. Call TidStoreGetOffsets() to obtain the offsets.
26  */
27 typedef struct TidStoreIterResult
28 {
32 
33 extern TidStore *TidStoreCreateLocal(size_t max_bytes, bool insert_only);
34 extern TidStore *TidStoreCreateShared(size_t max_bytes, int tranche_id);
35 extern TidStore *TidStoreAttach(dsa_handle area_handle, dsa_pointer handle);
36 extern void TidStoreDetach(TidStore *ts);
37 extern void TidStoreLockExclusive(TidStore *ts);
38 extern void TidStoreLockShare(TidStore *ts);
39 extern void TidStoreUnlock(TidStore *ts);
40 extern void TidStoreDestroy(TidStore *ts);
41 extern void TidStoreSetBlockOffsets(TidStore *ts, BlockNumber blkno, OffsetNumber *offsets,
42  int num_offsets);
43 extern bool TidStoreIsMember(TidStore *ts, ItemPointer tid);
47  OffsetNumber *offsets,
48  int max_offsets);
49 extern void TidStoreEndIterate(TidStoreIter *iter);
50 extern size_t TidStoreMemoryUsage(TidStore *ts);
52 extern dsa_area *TidStoreGetDSA(TidStore *ts);
53 
54 #endif /* TIDSTORE_H */
uint32 BlockNumber
Definition: block.h:31
uint64 dsa_pointer
Definition: dsa.h:62
dsm_handle dsa_handle
Definition: dsa.h:136
uint16 OffsetNumber
Definition: off.h:24
BlockNumber blkno
Definition: tidstore.h:29
void * internal_page
Definition: tidstore.h:30
Definition: dsa.c:348
TidStore * TidStoreAttach(dsa_handle area_handle, dsa_pointer handle)
Definition: tidstore.c:252
void TidStoreEndIterate(TidStoreIter *iter)
Definition: tidstore.c:526
void TidStoreDetach(TidStore *ts)
Definition: tidstore.c:277
TidStoreIterResult * TidStoreIterateNext(TidStoreIter *iter)
Definition: tidstore.c:501
void TidStoreLockShare(TidStore *ts)
Definition: tidstore.c:302
TidStore * TidStoreCreateShared(size_t max_bytes, int tranche_id)
Definition: tidstore.c:210
void TidStoreDestroy(TidStore *ts)
Definition: tidstore.c:325
dsa_area * TidStoreGetDSA(TidStore *ts)
Definition: tidstore.c:552
void TidStoreUnlock(TidStore *ts)
Definition: tidstore.c:309
TidStore * TidStoreCreateLocal(size_t max_bytes, bool insert_only)
Definition: tidstore.c:162
struct TidStoreIterResult TidStoreIterResult
bool TidStoreIsMember(TidStore *ts, ItemPointer tid)
Definition: tidstore.c:429
int TidStoreGetBlockOffsets(TidStoreIterResult *result, OffsetNumber *offsets, int max_offsets)
Definition: tidstore.c:574
TidStoreIter * TidStoreBeginIterate(TidStore *ts)
Definition: tidstore.c:479
void TidStoreLockExclusive(TidStore *ts)
Definition: tidstore.c:295
dsa_pointer TidStoreGetHandle(TidStore *ts)
Definition: tidstore.c:560
void TidStoreSetBlockOffsets(TidStore *ts, BlockNumber blkno, OffsetNumber *offsets, int num_offsets)
Definition: tidstore.c:353
size_t TidStoreMemoryUsage(TidStore *ts)
Definition: tidstore.c:540