forked from openGauss-Ecosystem/openGauss-server
parent
4d8aec12ae
commit
f8ff9f3afe
|
@ -1772,15 +1772,6 @@ static TupleTableSlot* agg_retrieve_hash_table(AggState* aggstate)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
int getPower2Num(int num)
|
||||
{
|
||||
int i = 1;
|
||||
while (i < num) {
|
||||
i <<= 1;
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
/* -----------------
|
||||
* ExecInitAgg
|
||||
*
|
||||
|
@ -3076,7 +3067,7 @@ Datum aggregate_dummy(PG_FUNCTION_ARGS)
|
|||
}
|
||||
|
||||
FORCE_INLINE void agg_spill_to_disk(AggWriteFileControl* TempFileControl, TupleHashTable hashtable,
|
||||
TupleTableSlot* hashslot, int numGroups, bool isAgg, int planId, int dop, Instrumentation* instrument)
|
||||
TupleTableSlot* hashslot, int64 numGroups, bool isAgg, int planId, int dop, Instrumentation* instrument)
|
||||
{
|
||||
if (TempFileControl->spillToDisk == false) {
|
||||
Assert(TempFileControl->finishwrite == false);
|
||||
|
@ -3140,7 +3131,7 @@ FORCE_INLINE void agg_spill_to_disk(AggWriteFileControl* TempFileControl, TupleH
|
|||
}
|
||||
|
||||
/* estimate num of temp file */
|
||||
int estsize = getPower2Num(4 * numGroups / TempFileControl->inmemoryRownum);
|
||||
int estsize = getPower2NextNum(4 * numGroups / TempFileControl->inmemoryRownum);
|
||||
TempFileControl->filenum = Max(HASH_MIN_FILENUMBER, estsize);
|
||||
TempFileControl->filenum = Min(TempFileControl->filenum, HASH_MAX_FILENUMBER);
|
||||
TempFileControl->filesource =
|
||||
|
|
|
@ -361,9 +361,8 @@ extern long ExecGetMemCostAgg(Agg*);
|
|||
extern void initialize_phase(AggState* aggstate, int newphase);
|
||||
extern List* find_hash_columns(AggState* aggstate);
|
||||
extern uint32 ComputeHashValue(TupleHashTable hashtbl);
|
||||
extern int getPower2Num(int num);
|
||||
extern void agg_spill_to_disk(AggWriteFileControl* TempFileControl, TupleHashTable hashtable, TupleTableSlot* hashslot,
|
||||
int numGroups, bool isAgg, int planId, int dop, Instrumentation* intrument = NULL);
|
||||
int64 numGroups, bool isAgg, int planId, int dop, Instrumentation* intrument = NULL);
|
||||
extern void ExecEarlyFreeAggregation(AggState* node);
|
||||
extern void ExecReSetAgg(AggState* node);
|
||||
|
||||
|
|
|
@ -356,7 +356,7 @@ inline int getPower2LessNum(int num)
|
|||
return i;
|
||||
}
|
||||
|
||||
inline int getPower2NextNum(int num)
|
||||
inline int getPower2NextNum(int64 num)
|
||||
{
|
||||
int i = 1;
|
||||
int count = 0;
|
||||
|
|
Loading…
Reference in New Issue