fix no spill size problem in parallel hash mod

This commit is contained in:
sqyyeah
2020-12-09 10:27:44 +08:00
parent ad9919e401
commit 5abcb2feb0
4 changed files with 11 additions and 1 deletions

View File

@ -582,3 +582,8 @@ static void sts_filename(char* name, size_t length, SharedTuplestoreAccessor* ac
error_t rc = snprintf_s(name, length, length - 1, "%s.p%d", accessor->sts->name, participant);
securec_check_ss(rc, "", "");
}
uint64 get_header_size(SharedTuplestoreAccessor* accessor)
{
return (uint64)accessor->sts->meta_data_size;
}

View File

@ -4014,8 +4014,9 @@ static void check_report_parameter(report_params* params)
*/
if (!g_instance.attr.attr_common.PGXCNodeName || g_instance.attr.attr_common.PGXCNodeName[0] == '\0') {
currentNodeName = "unknown name";
} else {
currentNodeName = g_instance.attr.attr_common.PGXCNodeName;
}
currentNodeName = g_instance.attr.attr_common.PGXCNodeName;
if ((strncmp(params->report_scope, g_nodeScope, strlen(g_nodeScope)) == 0) &&
((params->report_node == NULL) ||

View File

@ -30,6 +30,7 @@
#include "commands/tablespace.h"
#include "executor/execdebug.h"
#include "executor/hashjoin.h"
#include "utils/sharedtuplestore.h"
#include "executor/nodeHash.h"
#include "executor/nodeHashjoin.h"
#include "miscadmin.h"
@ -1782,6 +1783,8 @@ retry:
Assert(hashtable->batches[batchno].preallocated >= tuple_size);
hashtable->batches[batchno].preallocated -= tuple_size;
sts_puttuple(hashtable->batches[batchno].inner_tuples, &hashvalue, tuple);
hashtable->spill_count += 1;
*hashtable->spill_size += get_header_size(hashtable->batches[batchno].inner_tuples) + tuple->t_len;
}
++hashtable->batches[batchno].ntuples;
}

View File

@ -48,4 +48,5 @@ extern void sts_puttuple(SharedTuplestoreAccessor* accessor, const void* meta_da
extern MinimalTuple sts_parallel_scan_next(SharedTuplestoreAccessor* accessor, void* meta_data);
extern uint64 get_header_size(SharedTuplestoreAccessor* accessor);
#endif /* SHAREDTUPLESTORE_H */