forked from zhangh43/vectorize_engine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vectorTupleSlot.h
56 lines (48 loc) · 1.51 KB
/
vectorTupleSlot.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/*-------------------------------------------------------------------------
*
* vectortTupleSlot.h
* vector tuple table support stuff
*
*
* Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
*
*-------------------------------------------------------------------------
*/
#ifndef VECTOR_TUPLE_SLOT_H
#define VECTOR_TUPLE_SLOT_H
#include "executor/tuptable.h"
#include "storage/bufmgr.h"
#include "vtype/vtype.h"
/*
* VectorTupleSlot store a batch of tuples in each slot.
*/
typedef struct VectorTupleSlot
{
TupleTableSlot tts;
/* how many tuples does this slot contain */
int32 dim;
int32 bufnum;
/* batch of physical tuples */
HeapTupleData tts_tuples[BATCHSIZE];
/*
* tuples in slot would across many heap blocks,
* we need pin these buffers if needed.
*/
Buffer tts_buffers[BATCHSIZE];
/* skip array to represent filtered tuples */
bool skip[BATCHSIZE];
} VectorTupleSlot;
/* vector tuple slot related interface */
extern TupleTableSlot *VMakeTupleTableSlot(void);
extern TupleTableSlot *VExecAllocTableSlot(List **tupleTable);
extern void InitializeVectorSlotColumn(VectorTupleSlot *vslot);
extern TupleTableSlot *VExecStoreTuple(HeapTuple tuple,
TupleTableSlot *slot,
Buffer buffer,
bool shouldFree);
extern TupleTableSlot *VExecClearTuple(TupleTableSlot *slot);
extern void Vslot_getsomeattrs(TupleTableSlot *slot, int attnum);
extern void Vslot_getallattrs(TupleTableSlot *slot);
#endif