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

Commitf120b61

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 parent857ee8e commitf120b61

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
@@ -3023,15 +3023,15 @@ exec_stmt_return_query(PLpgSQL_execstate *estate,
30233023
if (stmt->query!=NULL)
30243024
{
30253025
/* static query */
3026-
exec_run_select(estate,stmt->query,0,&portal,true);
3026+
exec_run_select(estate,stmt->query,0,&portal,false);
30273027
}
30283028
else
30293029
{
30303030
/* RETURN QUERY EXECUTE */
30313031
Assert(stmt->dynquery!=NULL);
30323032
portal=exec_dynquery_with_params(estate,stmt->dynquery,
30333033
stmt->params,NULL,
3034-
CURSOR_OPT_PARALLEL_OK);
3034+
0);
30353035
}
30363036

30373037
/* Use eval_mcontext for tuple conversion work */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp