1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-08 11:42:09 +03:00

Add parallel_leader_participation GUC.

Sometimes, for testing, it's useful to have the leader do nothing but
read tuples from workers; and it's possible that could work out better
even in production.

Thomas Munro, reviewed by Amit Kapila and by me.  A few final tweaks
by me.

Discussion: http://postgr.es/m/CAEepm=2U++Lp3bNTv2Bv_kkr5NE2pOyHhxU=G0YTa4ZhSYhHiw@mail.gmail.com
This commit is contained in:
Robert Haas
2017-11-15 08:17:29 -05:00
parent 7518049980
commit e5253fdc4f
10 changed files with 205 additions and 9 deletions

View File

@ -23,6 +23,7 @@
#include "executor/tqueue.h"
#include "lib/binaryheap.h"
#include "miscadmin.h"
#include "optimizer/planmain.h"
#include "utils/memutils.h"
#include "utils/rel.h"
@ -233,8 +234,9 @@ ExecGatherMerge(PlanState *pstate)
}
}
/* always allow leader to participate */
node->need_to_scan_locally = true;
/* allow leader to participate if enabled or no choice */
if (parallel_leader_participation || node->nreaders == 0)
node->need_to_scan_locally = true;
node->initialized = true;
}