openGauss资源池化支持多机并行
This commit is contained in:
@ -115,6 +115,9 @@ typedef struct StreamState {
|
||||
int64* spill_size;
|
||||
void* sortstate; /* merge sort for stream */
|
||||
bool receive_message; /* The stream consumer has receive message from then producer */
|
||||
#ifdef USE_SPQ
|
||||
bool skip_direct_distribute_result;
|
||||
#endif
|
||||
} StreamState;
|
||||
|
||||
extern StreamState* ExecInitStream(Stream* node, EState* estate, int eflags);
|
||||
|
||||
@ -841,4 +841,7 @@ private:
|
||||
bool m_smpEnabled;
|
||||
};
|
||||
|
||||
#ifdef USE_SPQ
|
||||
extern bool IsJoinExprNull(List *joinExpr, ExprContext *econtext);
|
||||
#endif
|
||||
#endif /* EXECUTOR_H */
|
||||
|
||||
@ -724,11 +724,15 @@ public:
|
||||
/* get ThreadInstrumentation */
|
||||
ThreadInstrumentation *getThreadInstrumentation(int idx, int planNodeId, int smpId)
|
||||
{
|
||||
ThreadInstrumentation *threadInstr =
|
||||
#ifdef ENABLE_MULTIPLE_NODES
|
||||
getThreadInstrumentationCN(idx, planNodeId, smpId);
|
||||
ThreadInstrumentation *threadInstr = NULL;
|
||||
#if defined(ENABLE_MULTIPLE_NODES) || defined(USE_SPQ)
|
||||
if (t_thrd.spq_ctx.spq_role != ROLE_UTILITY) {
|
||||
threadInstr = getThreadInstrumentationCN(idx, planNodeId, smpId);
|
||||
} else {
|
||||
threadInstr = getThreadInstrumentationDN(planNodeId, smpId);
|
||||
}
|
||||
#else
|
||||
getThreadInstrumentationDN(planNodeId, smpId);
|
||||
threadInstr = getThreadInstrumentationDN(planNodeId, smpId);
|
||||
#endif /* ENABLE_MULTIPLE_NODES */
|
||||
return threadInstr;
|
||||
}
|
||||
|
||||
28
src/include/executor/node/nodeAssertOp.h
Normal file
28
src/include/executor/node/nodeAssertOp.h
Normal file
@ -0,0 +1,28 @@
|
||||
/* -------------------------------------------------------------------------
|
||||
*
|
||||
* nodeAssertOp.h
|
||||
*
|
||||
*
|
||||
* Portions Copyright (c) 2023 Huawei Technologies Co.,Ltd.
|
||||
* Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* src/include/executor/nodeAssertOp.h
|
||||
*
|
||||
* -------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifndef NODEASSERTOP_H
|
||||
#define NODEASSERTOP_H
|
||||
|
||||
#ifdef USE_SPQ
|
||||
#include "nodes/execnodes.h"
|
||||
|
||||
extern void ExecAssertOpExplainEnd(PlanState *planstate, struct StringInfoData *buf);
|
||||
extern TupleTableSlot* ExecAssertOp(PlanState *node);
|
||||
extern AssertOpState* ExecInitAssertOp(AssertOp *node, EState *estate, int eflags);
|
||||
extern void ExecEndAssertOp(AssertOpState *node);
|
||||
extern void ExecReScanAssertOp(AssertOpState *node);
|
||||
#endif /* USE_SPQ */
|
||||
|
||||
#endif /* NODEASSERTOP_H */
|
||||
@ -29,6 +29,10 @@ extern HashJoinTable ExecHashTableCreate(Hash* node, List* hashOperators, bool k
|
||||
extern void ExecHashTableDestroy(HashJoinTable hashtable);
|
||||
extern void ExecHashTableInsert(HashJoinTable hashtable, TupleTableSlot* slot, uint32 hashvalue, int planid, int dop,
|
||||
Instrumentation* instrument = NULL);
|
||||
#ifdef USE_SPQ
|
||||
extern bool ExecHashGetHashValue(HashJoinTable hashtable, ExprContext* econtext, List* hashkeys, bool outer_tuple,
|
||||
bool keep_nulls, uint32* hashvalue, bool *hashkeys_null);
|
||||
#endif
|
||||
extern bool ExecHashGetHashValue(HashJoinTable hashtable, ExprContext* econtext, List* hashkeys, bool outer_tuple,
|
||||
bool keep_nulls, uint32* hashvalue);
|
||||
extern void ExecHashGetBucketAndBatch(HashJoinTable hashtable, uint32 hashvalue, int* bucketno, int* batchno);
|
||||
|
||||
29
src/include/executor/node/nodeSequence.h
Normal file
29
src/include/executor/node/nodeSequence.h
Normal file
@ -0,0 +1,29 @@
|
||||
/*-------------------------------------------------------------------------
|
||||
*
|
||||
* nodeSequence.h
|
||||
* header file for nodeSequence.cpp.
|
||||
*
|
||||
* Portions Copyright (c) 2023 Huawei Technologies Co.,Ltd.
|
||||
* Portions Copyright (c) 2012 - 2022, EMC/Greenplum
|
||||
* Portions Copyright (c) 2012-Present VMware, Inc. or its affiliates.
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* src/include/executor/node/nodeSequence.h
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
#ifndef NODESEQUENCE_H
|
||||
#define NODESEQUENCE_H
|
||||
|
||||
#ifdef USE_SPQ
|
||||
#include "executor/tuptable.h"
|
||||
#include "nodes/execnodes.h"
|
||||
|
||||
extern SequenceState *ExecInitSequence(Sequence *node, EState *estate, int eflags);
|
||||
extern TupleTableSlot *ExecSequence(PlanState *pstate);
|
||||
extern void ExecReScanSequence(SequenceState *node);
|
||||
extern void ExecEndSequence(SequenceState *node);
|
||||
#endif /* USE_SPQ */
|
||||
|
||||
#endif
|
||||
38
src/include/executor/node/nodeShareInputScan.h
Normal file
38
src/include/executor/node/nodeShareInputScan.h
Normal file
@ -0,0 +1,38 @@
|
||||
/*-------------------------------------------------------------------------
|
||||
*
|
||||
* nodeShareInputScan.h
|
||||
*
|
||||
* Portions Copyright (c) 2023 Huawei Technologies Co.,Ltd.
|
||||
* Portions Copyright (c) 2012-2021 VMware, Inc. or its affiliates.
|
||||
* Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* src/include/executor/node/nodeShareInputScan.h
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
#ifndef NODESHAREINPUTSCAN_H
|
||||
#define NODESHAREINPUTSCAN_H
|
||||
|
||||
#ifdef USE_SPQ
|
||||
#include "nodes/execnodes.h"
|
||||
#include "storage/sharedfileset.h"
|
||||
|
||||
extern ShareInputScanState *ExecInitShareInputScan(ShareInputScan *node, EState *estate, int eflags);
|
||||
extern void ExecEndShareInputScan(ShareInputScanState *node);
|
||||
extern void ExecReScanShareInputScan(ShareInputScanState *node);
|
||||
extern TupleTableSlot *ExecShareInputScan(PlanState *pstate);
|
||||
|
||||
extern Size ShareInputShmemSize(void);
|
||||
extern void ShareInputShmemInit(void);
|
||||
|
||||
extern SharedFileSet *get_shareinput_fileset(void);
|
||||
|
||||
extern void tuplestore_make_shared(Tuplestorestate *state, SharedFileSet *fileset, const char *filename);
|
||||
extern void tuplestore_freeze(Tuplestorestate *state);
|
||||
extern Tuplestorestate *tuplestore_open_shared(SharedFileSet *fileset, const char *filename);
|
||||
#endif /* USE_SPQ */
|
||||
|
||||
#endif /* NODESHAREINPUTSCAN_H */
|
||||
32
src/include/executor/node/nodeSpqSeqscan.h
Normal file
32
src/include/executor/node/nodeSpqSeqscan.h
Normal file
@ -0,0 +1,32 @@
|
||||
/* -------------------------------------------------------------------------
|
||||
*
|
||||
* nodeSpqSeqscan.h
|
||||
*
|
||||
* Portions Copyright (c) 2023 Huawei Technologies Co.,Ltd.
|
||||
*
|
||||
* src/include/executor/node/nodeSpqSeqscan.h
|
||||
*
|
||||
* -------------------------------------------------------------------------
|
||||
*/
|
||||
#ifdef USE_SPQ
|
||||
#ifndef NODESPQSEQSCAN_H
|
||||
#define NODESPQSEQSCAN_H
|
||||
|
||||
#include "nodes/execnodes.h"
|
||||
|
||||
typedef SpqSeqScanState* (*init_spqscan_hook_type)(SpqSeqScan* node, EState* estate, int eflags);
|
||||
typedef TupleTableSlot* (*exec_spqscan_hook_type)(PlanState* node);
|
||||
typedef void (*end_spqscan_hook_type)(SpqSeqScanState* node);
|
||||
typedef void (*spqscan_rescan_hook_type)(SpqSeqScanState* node);
|
||||
|
||||
extern THR_LOCAL init_spqscan_hook_type init_spqscan_hook;
|
||||
extern THR_LOCAL exec_spqscan_hook_type exec_spqscan_hook;
|
||||
extern THR_LOCAL end_spqscan_hook_type end_spqscan_hook;
|
||||
extern THR_LOCAL spqscan_rescan_hook_type spqscan_rescan_hook;
|
||||
|
||||
// unchanged function compare with seqscan
|
||||
extern void ExecSpqSeqMarkPos(SpqSeqScanState* node);
|
||||
extern void ExecSpqSeqRestrPos(SpqSeqScanState* node);
|
||||
|
||||
#endif // NODESPQSEQSCAN_H
|
||||
#endif
|
||||
@ -249,5 +249,12 @@ extern void heap_slot_getsomeattrs(TupleTableSlot* slot, int attnum);
|
||||
extern bool heap_slot_attisnull(TupleTableSlot* slot, int attnum);
|
||||
extern void heap_slot_formbatch(TupleTableSlot* slot, struct VectorBatch* batch, int cur_rows, int attnum);
|
||||
|
||||
#ifdef USE_SPQ
|
||||
extern Datum slot_getattr(TupleTableSlot *slot, int attnum, bool *isnull);
|
||||
extern void slot_getsomeattrs(TupleTableSlot *slot, int attnum);
|
||||
extern void slot_getallattrs(TupleTableSlot *slot);
|
||||
extern Datum heap_copy_tuple_as_datum(HeapTuple tuple, TupleDesc tupleDesc);
|
||||
#endif
|
||||
|
||||
#endif /* !FRONTEND_PARSER */
|
||||
#endif /* TUPTABLE_H */
|
||||
|
||||
Reference in New Issue
Block a user