Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit37e0a01

Browse files
committed
Save a few cycles in plpgsql simple-expression initialization.
Instead of using ExecPrepareExpr, call ExecInitExpr. The net change hereis that we don't apply expression_planner() to the expression tree. Thereis no need to do so, because that tree is extracted from a fully plannedplancache entry, so all the needed work is already done. This reducesthe setup costs by about a factor of 2 according to some simple tests.Oversight noted while fooling around with the simple-expression code forprevious fix.
1 parent8ce22dd commit37e0a01

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

‎src/pl/plpgsql/src/pl_exec.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4577,10 +4577,11 @@ exec_eval_simple_expr(PLpgSQL_execstate *estate,
45774577
*/
45784578
if (expr->expr_simple_lxid!=curlxid)
45794579
{
4580-
expr->expr_simple_state=ExecPrepareExpr(expr->expr_simple_expr,
4581-
simple_eval_estate);
4580+
oldcontext=MemoryContextSwitchTo(simple_eval_estate->es_query_cxt);
4581+
expr->expr_simple_state=ExecInitExpr(expr->expr_simple_expr,NULL);
45824582
expr->expr_simple_in_use= false;
45834583
expr->expr_simple_lxid=curlxid;
4584+
MemoryContextSwitchTo(oldcontext);
45844585
}
45854586

45864587
/*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp