Skip to content

Commit 8bfee76

Browse files
committed
Add the beginning backbone of the vertex am
1 parent 72a080d commit 8bfee76

File tree

2 files changed

+138
-0
lines changed

2 files changed

+138
-0
lines changed

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ OBJS = src/backend/postgraph.o \
2525
src/backend/access/ivfflat/ivfscan.o \
2626
src/backend/access/ivfflat/ivfutils.o \
2727
src/backend/access/ivfflat/ivfvacuum.o \
28+
src/backend/access/vertex_heap/vertex_heapam_handler.o \
2829
src/backend/catalog/ag_catalog.o \
2930
src/backend/catalog/ag_graph.o \
3031
src/backend/catalog/ag_label.o \
Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
/*-------------------------------------------------------------------------
2+
*
3+
* vertex_heapam_handler.c
4+
* vertex heap access method code
5+
*
6+
* Portions Copyright (c) 2025, PostGraphDB
7+
* Portions Copyright (c) 1996-2021, PostgreSQL Global Development Group
8+
* Portions Copyright (c) 1994, Regents of the University of California
9+
*
10+
*
11+
* IDENTIFICATION
12+
* src/backend/access/vertex_heap/vertex_heapam_handler.c
13+
*
14+
*
15+
* NOTES
16+
* This files wires up the lower level heapam.c et al routines with the
17+
* tableam abstraction.
18+
*
19+
*-------------------------------------------------------------------------
20+
*/
21+
#include "postgres.h"
22+
23+
#include "access/genam.h"
24+
#include "access/heapam.h"
25+
#include "access/heaptoast.h"
26+
#include "access/multixact.h"
27+
#include "access/rewriteheap.h"
28+
#include "access/syncscan.h"
29+
#include "access/tableam.h"
30+
#include "access/tsmapi.h"
31+
#include "access/xact.h"
32+
#include "catalog/catalog.h"
33+
#include "catalog/index.h"
34+
#include "catalog/storage.h"
35+
#include "catalog/storage_xlog.h"
36+
#include "commands/progress.h"
37+
#include "executor/executor.h"
38+
#include "miscadmin.h"
39+
#include "pgstat.h"
40+
#include "storage/bufmgr.h"
41+
#include "storage/bufpage.h"
42+
#include "storage/lmgr.h"
43+
#include "storage/predicate.h"
44+
#include "storage/procarray.h"
45+
#include "storage/smgr.h"
46+
#include "utils/builtins.h"
47+
#include "utils/rel.h"
48+
49+
50+
/* ------------------------------------------------------------------------
51+
* Slot related callbacks for vertex heap AM
52+
* ------------------------------------------------------------------------
53+
*/
54+
55+
static const TupleTableSlotOps *
56+
vertex_heapam_slot_callbacks(Relation relation)
57+
{
58+
return &TTSOpsBufferHeapTuple;
59+
}
60+
61+
62+
/* ------------------------------------------------------------------------
63+
* Definition of the heap table access method.
64+
* ------------------------------------------------------------------------
65+
*/
66+
67+
static const TableAmRoutine vertex_heapam_methods = {
68+
.type = T_TableAmRoutine,
69+
70+
.slot_callbacks = vertex_heapam_slot_callbacks,
71+
72+
.scan_begin = NULL,
73+
.scan_end = NULL,
74+
.scan_rescan = NULL,
75+
.scan_getnextslot = NULL,
76+
77+
.scan_set_tidrange = NULL,
78+
.scan_getnextslot_tidrange = NULL,
79+
80+
.parallelscan_estimate = NULL,
81+
.parallelscan_initialize = NULL,
82+
.parallelscan_reinitialize = NULL,
83+
84+
.index_fetch_begin = NULL,
85+
.index_fetch_reset = NULL,
86+
.index_fetch_end = NULL,
87+
.index_fetch_tuple = NULL,
88+
89+
.tuple_insert = NULL,
90+
.tuple_insert_speculative = NULL,
91+
.tuple_complete_speculative = NULL,
92+
.multi_insert = NULL,
93+
.tuple_delete = NULL,
94+
.tuple_update = NULL,
95+
.tuple_lock = NULL,
96+
97+
.tuple_fetch_row_version = NULL,
98+
.tuple_get_latest_tid = NULL,
99+
.tuple_tid_valid = NULL,
100+
.tuple_satisfies_snapshot = NULL,
101+
.index_delete_tuples = NULL,
102+
103+
.relation_set_new_filenode = NULL,
104+
.relation_nontransactional_truncate = NULL,
105+
.relation_copy_data = NULL,
106+
.relation_copy_for_cluster = NULL,
107+
.relation_vacuum = NULL,
108+
.scan_analyze_next_block = NULL,
109+
.scan_analyze_next_tuple = NULL,
110+
.index_build_range_scan = NULL,
111+
.index_validate_scan = NULL,
112+
113+
.relation_size = NULL,
114+
.relation_needs_toast_table = NULL,
115+
.relation_toast_am = NULL,
116+
.relation_fetch_toast_slice = NULL,
117+
118+
.relation_estimate_size = NULL,
119+
120+
.scan_bitmap_next_block = NULL,
121+
.scan_bitmap_next_tuple = NULL,
122+
.scan_sample_next_block = NULL,
123+
.scan_sample_next_tuple = NULL
124+
};
125+
126+
127+
const TableAmRoutine *
128+
GetVertexHeapamTableAmRoutine(void)
129+
{
130+
return &vertex_heapam_methods;
131+
}
132+
133+
Datum
134+
vertex_heap_tableam_handler(PG_FUNCTION_ARGS)
135+
{
136+
PG_RETURN_POINTER(&vertex_heapam_methods);
137+
}

0 commit comments

Comments
 (0)