streamDesc use normal hash table

This commit is contained in:
jin.zhao
2024-08-15 18:01:19 +08:00
committed by zhaosen
parent cf050ccb7b
commit ee0023f8a6
3 changed files with 43 additions and 33 deletions

View File

@ -28,7 +28,6 @@
#define SRC_INCLUDE_DISTRIBUTELAYER_STREAMCORE_H_
#include <signal.h>
#include <unordered_map>
#include "postgres.h"
#include "knl/knl_variable.h"
@ -59,6 +58,8 @@
#define TupleVectorMaxSize 100
#define STREAM_DESC_HASH_NUMBER 256
#define IS_STREAM_PORTAL (!StreamThreadAmI() && portal->streamInfo.streamGroup != NULL)
struct StreamState;
@ -104,6 +105,11 @@ typedef struct {
uint64 key;
} StreamConnectSyncElement;
typedef struct {
StreamKey key;
ParallelIndexScanDescData* parallelDesc;
} StreamDescElement;
enum StreamObjType {
STREAM_PRODUCER,
STREAM_CONSUMER,
@ -526,21 +532,7 @@ private:
/* Mark Stream query quit status. */
StreamObjStatus m_quitStatus;
#endif
struct KeyHash {
std::size_t operator()(const StreamKey& k) const
{
return std::hash<uint>()(k.queryId) ^
(std::hash<uint>()(k.planNodeId) << 1);
}
};
struct KeyEqual {
bool operator()(const StreamKey& lhs, const StreamKey& rhs) const
{
return lhs.queryId == rhs.queryId && lhs.planNodeId == rhs.planNodeId;
}
};
std::unordered_map<StreamKey, void*, KeyHash, KeyEqual> m_streamDesc;
static HTAB* m_streamDescHashTbl;
};
extern bool IsThreadProcessStreamRecursive();

View File

@ -29,6 +29,4 @@ extern int TableScanBitmapNextTargetRel(TableScanDesc scan, BitmapHeapScanState
extern TupleTableSlot* ExecBitmapHeapScan(PlanState* state);
extern void ExecInitPartitionForBitmapHeapScan(BitmapHeapScanState* scanstate, EState* estate);
#define BITMAP_PREFETCH_PAGE_RATIO 2
#endif /* NODEBITMAPHEAPSCAN_H */