From 867dd2dc8704e58636b8599f61ada3d83c7e6473 Mon Sep 17 00:00:00 2001 From: Jeff Davis Date: Fri, 8 Dec 2023 11:16:01 -0800 Subject: Cache opaque handle for GUC option to avoid repeasted lookups. When setting GUCs from proconfig, performance is important, and hash lookups in the GUC table are significant. Per suggestion from Robert Haas. Discussion: https://postgr.es/m/CA+TgmoYpKxhR3HOD9syK2XwcAUVPa0+ba0XPnwWBcYxtKLkyxA@mail.gmail.com Reviewed-by: John Naylor --- src/include/utils/guc.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/include') diff --git a/src/include/utils/guc.h b/src/include/utils/guc.h index 20fe13702b1..49ee046cf0f 100644 --- a/src/include/utils/guc.h +++ b/src/include/utils/guc.h @@ -144,6 +144,8 @@ typedef struct ConfigVariable struct ConfigVariable *next; } ConfigVariable; +typedef struct config_generic config_handle; + extern bool ParseConfigFile(const char *config_file, bool strict, const char *calling_file, int calling_lineno, int depth, int elevel, @@ -387,6 +389,13 @@ extern int set_config_option_ext(const char *name, const char *value, Oid srole, GucAction action, bool changeVal, int elevel, bool is_reload); +extern int set_config_with_handle(const char *name, config_handle *handle, + const char *value, + GucContext context, GucSource source, + Oid srole, + GucAction action, bool changeVal, + int elevel, bool is_reload); +extern config_handle *get_config_handle(const char *name); extern void AlterSystemSetConfigFile(AlterSystemStmt *altersysstmt); extern char *GetConfigOptionByName(const char *name, const char **varname, bool missing_ok); -- cgit v1.2.3