!2375 合并pg优化,必要时增加hashjoin的bucket数量

Merge pull request !2375 from wanghao19920907/PR_2297
This commit is contained in:
opengauss-bot
2023-02-21 08:38:55 +00:00
committed by Gitee
7 changed files with 156 additions and 32 deletions

View File

@ -126,6 +126,10 @@ typedef struct HashJoinTableData {
struct HashJoinTupleData** buckets;
/* buckets array is per-batch storage, as are all the tuples */
int nbuckets_original; /* # buckets when starting the first hash */
int nbuckets_optimal; /* optimal # buckets (per batch) */
int log2_nbuckets_optimal; /* same as log2_nbuckets optimal */
bool keepNulls; /* true to store unmatchable NULL tuples */
bool skewEnabled; /* are we using skew optimization? */
@ -143,6 +147,7 @@ typedef struct HashJoinTableData {
bool growEnabled; /* flag to shut off nbatch increases */
double totalTuples; /* # tuples obtained from inner plan */
double skewTuples; /* # tuples inserted into skew tuples */
/*
* These arrays are allocated for the life of the hash join, but only if