提交 59165cfa 编写于 作者: J Jacob Champion 提交者: GitHub

Convert GPDB-specific GUCs to the new "enum" type

Several GUCs are simply enumerated strings that are parsed into integer
types behind the scenes. As of 8.4, the GUC system recognizes a new
type, enum, which will do this for us. Move as many as we can to the new
system.

As part of this,
- gp_idf_deduplicate was changed from a char* string to an int, and new
  IDF_DEDUPLICATE_* macros were added for each option
- password_hash_algorithm was changed to an int
- for codegen_optimization_level, "none" is the default now when codegen
  is not enabled during compilation (instead of the empty string).

A couple of GUCs that *could* be represented as enums
(optimizer_minidump, gp_workfile_compress_algorithm) have been
purposefully kept with the prior system because they require the GUC
variable to be something other than an integer anyway.
Signed-off-by: NJacob Champion <pchampion@pivotal.io>
上级 4c7f65be
......@@ -5144,9 +5144,9 @@ choose_deduplicate(PlannerInfo *root, List *sortExprs,
*numGroups = num_distinct;
/* we need some calculates above even if the flag is off */
if (pg_strcasecmp(gp_idf_deduplicate_str, "force") == 0)
if (gp_idf_deduplicate == IDF_DEDUPLICATE_FORCE)
return true;
if (pg_strcasecmp(gp_idf_deduplicate_str, "none") == 0)
if (gp_idf_deduplicate == IDF_DEDUPLICATE_NONE)
return false;
return dedup_cost < naive_cost;
......
此差异已折叠。
......@@ -1065,7 +1065,11 @@ extern void increment_command_count(void);
/*
* switch to control inverse distribution function strategy.
*/
extern char *gp_idf_deduplicate_str;
extern int gp_idf_deduplicate;
#define IDF_DEDUPLICATE_AUTO 0
#define IDF_DEDUPLICATE_NONE 1
#define IDF_DEDUPLICATE_FORCE 2
/* default to RANDOM distribution for CREATE TABLE without DISTRIBUTED BY */
extern bool gp_create_table_random_default_distribution;
......
......@@ -26,6 +26,6 @@ typedef enum
PASSWORD_HASH_SHA_256
} PasswdHashAlg;
extern PasswdHashAlg password_hash_algorithm;
extern int password_hash_algorithm;
#endif
......@@ -361,7 +361,6 @@ extern char *application_name;
extern char *Debug_dtm_action_sql_command_tag;
extern char *Debug_dtm_action_str;
extern char *Debug_dtm_action_target_str;
extern char *Debug_dtm_action_protocol_str;
/* Enable check for compatibility of encoding and locale in createdb */
extern bool gp_encoding_check_locale_compatibility;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册