PostgreSQL Source Code git master
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
tidstore.h
Go to the documentation of this file.
1/*-------------------------------------------------------------------------
2 *
3 * tidstore.h
4 * TidStore interface.
5 *
6 *
7 * Portions Copyright (c) 1996-2025, 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
20typedef struct TidStore TidStore;
22
23/*
24 * Result struct for TidStoreIterateNext. This is copyable, but should be
25 * treated as opaque. Call TidStoreGetBlockOffsets() to obtain the offsets.
26 */
27typedef struct TidStoreIterResult
28{
32
33extern TidStore *TidStoreCreateLocal(size_t max_bytes, bool insert_only);
34extern TidStore *TidStoreCreateShared(size_t max_bytes, int tranche_id);
35extern TidStore *TidStoreAttach(dsa_handle area_handle, dsa_pointer handle);
36extern void TidStoreDetach(TidStore *ts);
37extern void TidStoreLockExclusive(TidStore *ts);
38extern void TidStoreLockShare(TidStore *ts);
39extern void TidStoreUnlock(TidStore *ts);
40extern void TidStoreDestroy(TidStore *ts);
41extern void TidStoreSetBlockOffsets(TidStore *ts, BlockNumber blkno, OffsetNumber *offsets,
42 int num_offsets);
43extern bool TidStoreIsMember(TidStore *ts, ItemPointer tid);
47 OffsetNumber *offsets,
48 int max_offsets);
49extern void TidStoreEndIterate(TidStoreIter *iter);
50extern size_t TidStoreMemoryUsage(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
dsa_area * TidStoreGetDSA(TidStore *ts)
Definition: tidstore.c:544
TidStoreIter * TidStoreBeginIterate(TidStore *ts)
Definition: tidstore.c:471
void TidStoreEndIterate(TidStoreIter *iter)
Definition: tidstore.c:518
void TidStoreDetach(TidStore *ts)
Definition: tidstore.c:269
TidStoreIterResult * TidStoreIterateNext(TidStoreIter *iter)
Definition: tidstore.c:493
void TidStoreLockShare(TidStore *ts)
Definition: tidstore.c:294
TidStore * TidStoreCreateLocal(size_t max_bytes, bool insert_only)
Definition: tidstore.c:162
void TidStoreDestroy(TidStore *ts)
Definition: tidstore.c:317
void TidStoreUnlock(TidStore *ts)
Definition: tidstore.c:301
struct TidStoreIterResult TidStoreIterResult
TidStore * TidStoreAttach(dsa_handle area_handle, dsa_pointer handle)
Definition: tidstore.c:244
bool TidStoreIsMember(TidStore *ts, ItemPointer tid)
Definition: tidstore.c:421
int TidStoreGetBlockOffsets(TidStoreIterResult *result, OffsetNumber *offsets, int max_offsets)
Definition: tidstore.c:566
void TidStoreLockExclusive(TidStore *ts)
Definition: tidstore.c:287
dsa_pointer TidStoreGetHandle(TidStore *ts)
Definition: tidstore.c:552
void TidStoreSetBlockOffsets(TidStore *ts, BlockNumber blkno, OffsetNumber *offsets, int num_offsets)
Definition: tidstore.c:345
size_t TidStoreMemoryUsage(TidStore *ts)
Definition: tidstore.c:532
TidStore * TidStoreCreateShared(size_t max_bytes, int tranche_id)
Definition: tidstore.c:208