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

Commit5674a25

Browse files
committed
plpgsql: Don't generate parallel plans for RETURN QUERY.
Commit7aea8e4 allowed a parallelplan to be generated when for a RETURN QUERY or RETURN QUERY EXECUTEstatement in a PL/pgsql block, but that's a bad idea because plplgsqlasks the executor for 50 rows at a time. That means that we'll alwaysbe running serially a plan that was intended for parallel execution,which is not a good idea. Fix by not requesting a parallel plan fromthe outset.Per discussion, back-patch to 9.6. There is a slight risk that, dueto optimizer error, somebody could have a case where the parallel planexecuted serially is actually faster than the supposedly-best serialplan, but the consensus seems to be that that's not sufficientjustification for leaving 9.6 unpatched.Discussion:http://postgr.es/m/CA+TgmoZ_ZuH+auEeeWnmtorPsgc_SmP+XWbDsJ+cWvWBSjNwDQ@mail.gmail.comDiscussion:http://postgr.es/m/CA+TgmobXEhvHbJtWDuPZM9bVSLiTj-kShxQJ2uM5GPDze9fRYA@mail.gmail.com
1 parent2ed391f commit5674a25

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2870,15 +2870,15 @@ exec_stmt_return_query(PLpgSQL_execstate *estate,
28702870
if (stmt->query!=NULL)
28712871
{
28722872
/* static query */
2873-
exec_run_select(estate,stmt->query,0,&portal,true);
2873+
exec_run_select(estate,stmt->query,0,&portal,false);
28742874
}
28752875
else
28762876
{
28772877
/* RETURN QUERY EXECUTE */
28782878
Assert(stmt->dynquery!=NULL);
28792879
portal=exec_dynquery_with_params(estate,stmt->dynquery,
28802880
stmt->params,NULL,
2881-
CURSOR_OPT_PARALLEL_OK);
2881+
0);
28822882
}
28832883

28842884
tupmap=convert_tuples_by_position(portal->tupDesc,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp