hawq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hubertzh...@apache.org
Subject incubator-hawq git commit: HAWQ-76. add guc to determine whether to convert hash table to random with enforcement
Date Sun, 25 Oct 2015 01:15:26 GMT
Repository: incubator-hawq
Updated Branches:
  refs/heads/master fdd2ae17b -> e9fe5f331


HAWQ-76. add guc to determine whether to convert hash table to random with enforcement


Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-hawq/commit/e9fe5f33
Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/e9fe5f33
Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/e9fe5f33

Branch: refs/heads/master
Commit: e9fe5f331881bd786a6cfec3f50df763af45dc19
Parents: fdd2ae1
Author: hzhang2 <zhanghuan929@163.com>
Authored: Sun Oct 25 09:13:34 2015 +0800
Committer: hzhang2 <zhanghuan929@163.com>
Committed: Sun Oct 25 09:13:34 2015 +0800

----------------------------------------------------------------------
 src/backend/cdb/cdbdatalocality.c |  4 +++-
 src/backend/cdb/cdbvars.c         |  1 +
 src/backend/utils/misc/guc.c      | 11 +++++++++++
 src/include/cdb/cdbvars.h         |  9 +++++++++
 4 files changed, 24 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/e9fe5f33/src/backend/cdb/cdbdatalocality.c
----------------------------------------------------------------------
diff --git a/src/backend/cdb/cdbdatalocality.c b/src/backend/cdb/cdbdatalocality.c
index db7013c..24d8b05 100644
--- a/src/backend/cdb/cdbdatalocality.c
+++ b/src/backend/cdb/cdbdatalocality.c
@@ -2532,7 +2532,9 @@ static bool allocate_hash_relation(Relation_Data* rel_data,
 		}
 	}
 	/*for now orca doesn't support convert hash to random*/
-	else if(relationDatalocality < hash2RandomDatalocalityThreshold && relationDatalocality
>= 0 && !optimizer){
+	else if((hash_to_random_flag == ENFORCE_HASH_TO_RANDOM ||
+			(relationDatalocality < hash2RandomDatalocalityThreshold && relationDatalocality
>= 0 && !optimizer))
+			&& hash_to_random_flag != ENFORCE_KEEP_HASH){
 		log_context->totalDataSizePerRelation =0;
 		log_context->localDataSizePerRelation =0;
 		return true;

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/e9fe5f33/src/backend/cdb/cdbvars.c
----------------------------------------------------------------------
diff --git a/src/backend/cdb/cdbvars.c b/src/backend/cdb/cdbvars.c
index d6a784d..921e87f 100644
--- a/src/backend/cdb/cdbvars.c
+++ b/src/backend/cdb/cdbvars.c
@@ -272,6 +272,7 @@ int debug_fix_vseg_num;
 int max_filecount_notto_split_segment;
 int min_datasize_to_combine_segment;
 int datalocality_algorithm_version;
+int hash_to_random_flag;
 bool metadata_cache_enable;
 int metadata_cache_block_capacity;
 

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/e9fe5f33/src/backend/utils/misc/guc.c
----------------------------------------------------------------------
diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c
index 5a2c90a..9c8b6ef 100644
--- a/src/backend/utils/misc/guc.c
+++ b/src/backend/utils/misc/guc.c
@@ -6372,6 +6372,17 @@ static struct config_int ConfigureNamesInt[] =
 	},
 
 	{
+		  {"hash_to_random_flag", PGC_USERSET, DEVELOPER_OPTIONS,
+				gettext_noop("Sets whether convert hash to random, 0: HASH_TO_RANDOM_BASEDON_DATALOCALITY,
"
+						"1: ENFORCE_HASH_TO_RANDOM, 2: ENFORCE_KEEP_HASH"),
+				NULL,
+				GUC_NO_SHOW_ALL | GUC_NOT_IN_SAMPLE
+			},
+			&hash_to_random_flag,
+			0, 0, 2 ,NULL, NULL
+	},
+
+	{
 		{"hawq_resourceenforcer_cleanup_period", PGC_USERSET, DEVELOPER_OPTIONS,
 			gettext_noop("period for resource enforcer to cleanup cgroups."),
 			NULL,

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/e9fe5f33/src/include/cdb/cdbvars.h
----------------------------------------------------------------------
diff --git a/src/include/cdb/cdbvars.h b/src/include/cdb/cdbvars.h
index 64d8b74..a9e0eef 100644
--- a/src/include/cdb/cdbvars.h
+++ b/src/include/cdb/cdbvars.h
@@ -1211,4 +1211,13 @@ extern int     rm_max_resource_queue_number;
 extern int max_filecount_notto_split_segment;
 extern int min_datasize_to_combine_segment;
 extern int datalocality_algorithm_version;
+
+typedef enum
+{
+	HASH_TO_RANDOM_BASEDON_DATALOCALITY = 0,
+	ENFORCE_HASH_TO_RANDOM ,
+	ENFORCE_KEEP_HASH,
+} HashToRandomFlagValue;
+
+extern int hash_to_random_flag;
 #endif   /* GPVARS_H */


Mime
View raw message