Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: performance optimization #530

Merged
merged 1 commit into from
Sep 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 14 additions & 8 deletions src/backend/tcop/postgres.c
Original file line number Diff line number Diff line change
Expand Up @@ -2175,10 +2175,6 @@ exec_bind_message(StringInfo input_message)
if (whereToSendOutput == DestRemote)
pq_putemptymessage('2');

/* POLAR: get errmsg params string, we must free it in the last */
params_string = polar_get_errmsg_params(params);
/* POLAR end */

/*
* Emit duration logging if appropriate.
*/
Expand All @@ -2195,6 +2191,14 @@ exec_bind_message(StringInfo input_message)
StringInfoData buf;

initStringInfo(&buf);

/*
* POLAR: get errmsg params string, we must free it in the
* last.
*/
params_string = polar_get_errmsg_params(params);
/* POLAR end */

if (polar_enable_output_search_path_to_log)
appendStringInfo(&buf, "/*%s*/ ", namespace_search_path);
ereport(LOG,
Expand All @@ -2209,6 +2213,12 @@ exec_bind_message(StringInfo input_message)
polar_mark_slow_log(true), /* POLAR */
errhidestmt(true)));
pfree(buf.data);

/* POLAR: free params_string */
if (params_string)
pfree(params_string);
/* POLAR end */

break;
}
}
Expand All @@ -2218,10 +2228,6 @@ exec_bind_message(StringInfo input_message)

if (numParams == 0)
hit_polar_unique_feature(UnparameterizedStmtExecCount);
/* POLAR: free params_string */
if (params_string)
pfree(params_string);
/* POLAR end */

if (save_log_statement_stats)
ShowUsage("BIND MESSAGE STATISTICS");
Expand Down
2 changes: 1 addition & 1 deletion src/backend/utils/misc/guc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1638,7 +1638,7 @@ static struct config_bool ConfigureNamesBool[] =
GUC_NO_RESET_ALL | POLAR_GUC_IS_INVISIBLE | POLAR_GUC_IS_UNCHANGABLE
},
&polar_enable_xact_split,
true,
false,
NULL, NULL, NULL
},

Expand Down