Commit 5674a25
committed
plpgsql: Don't generate parallel plans for RETURN QUERY.
Commit 7aea8e4 allowed a parallel
plan to be generated when for a RETURN QUERY or RETURN QUERY EXECUTE
statement in a PL/pgsql block, but that's a bad idea because plplgsql
asks the executor for 50 rows at a time. That means that we'll always
be running serially a plan that was intended for parallel execution,
which is not a good idea. Fix by not requesting a parallel plan from
the outset.
Per discussion, back-patch to 9.6. There is a slight risk that, due
to optimizer error, somebody could have a case where the parallel plan
executed serially is actually faster than the supposedly-best serial
plan, but the consensus seems to be that that's not sufficient
justification for leaving 9.6 unpatched.
Discussion: http://postgr.es/m/CA+TgmoZ_ZuH+auEeeWnmtorPsgc_SmP+XWbDsJ+cWvWBSjNwDQ@mail.gmail.com
Discussion: http://postgr.es/m/CA+TgmobXEhvHbJtWDuPZM9bVSLiTj-kShxQJ2uM5GPDze9fRYA@mail.gmail.com1 parent 2ed391f commit 5674a25
1 file changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2870 | 2870 | | |
2871 | 2871 | | |
2872 | 2872 | | |
2873 | | - | |
| 2873 | + | |
2874 | 2874 | | |
2875 | 2875 | | |
2876 | 2876 | | |
2877 | 2877 | | |
2878 | 2878 | | |
2879 | 2879 | | |
2880 | 2880 | | |
2881 | | - | |
| 2881 | + | |
2882 | 2882 | | |
2883 | 2883 | | |
2884 | 2884 | | |
| |||
0 commit comments