Remove TupleDesc remapping logic from tqueue.c.

With the introduction of a shared memory record typmod registry, it is no
longer necessary to remap record typmods when sending tuples between backends
so most of tqueue.c can be removed.

Author: Thomas Munro
Reviewed-By: Andres Freund
Discussion: https://postgr.es/m/CAEepm=0ZtQ-SpsgCyzzYpsXS6e=kZWqk3g5Ygn3MDV7A8dabUA@mail.gmail.com
This commit is contained in:
Andres Freund 2017-09-14 19:59:02 -07:00
parent cc5f81366c
commit 6b65a7fe62
6 changed files with 27 additions and 1110 deletions

View File

@ -608,14 +608,12 @@ ExecInitParallelPlan(PlanState *planstate, EState *estate, int nworkers,
/*
* Set up tuple queue readers to read the results of a parallel subplan.
* All the workers are expected to return tuples matching tupDesc.
*
* This is separate from ExecInitParallelPlan() because we can launch the
* worker processes and let them start doing something before we do this.
*/
void
ExecParallelCreateReaders(ParallelExecutorInfo *pei,
TupleDesc tupDesc)
ExecParallelCreateReaders(ParallelExecutorInfo *pei)
{
int nworkers = pei->pcxt->nworkers_launched;
int i;
@ -631,8 +629,7 @@ ExecParallelCreateReaders(ParallelExecutorInfo *pei,
{
shm_mq_set_handle(pei->tqueue[i],
pei->pcxt->worker[i].bgwhandle);
pei->reader[i] = CreateTupleQueueReader(pei->tqueue[i],
tupDesc);
pei->reader[i] = CreateTupleQueueReader(pei->tqueue[i]);
}
}
}

View File

@ -176,8 +176,7 @@ ExecGather(PlanState *pstate)
/* Set up tuple queue readers to read the results. */
if (pcxt->nworkers_launched > 0)
{
ExecParallelCreateReaders(node->pei,
fslot->tts_tupleDescriptor);
ExecParallelCreateReaders(node->pei);
/* Make a working array showing the active readers */
node->nreaders = pcxt->nworkers_launched;
node->reader = (TupleQueueReader **)

View File

@ -217,7 +217,7 @@ ExecGatherMerge(PlanState *pstate)
/* Set up tuple queue readers to read the results. */
if (pcxt->nworkers_launched > 0)
{
ExecParallelCreateReaders(node->pei, node->tupDesc);
ExecParallelCreateReaders(node->pei);
/* Make a working array showing the active readers */
node->nreaders = pcxt->nworkers_launched;
node->reader = (TupleQueueReader **)

File diff suppressed because it is too large Load Diff

View File

@ -36,8 +36,7 @@ typedef struct ParallelExecutorInfo
extern ParallelExecutorInfo *ExecInitParallelPlan(PlanState *planstate,
EState *estate, int nworkers, int64 tuples_needed);
extern void ExecParallelCreateReaders(ParallelExecutorInfo *pei,
TupleDesc tupDesc);
extern void ExecParallelCreateReaders(ParallelExecutorInfo *pei);
extern void ExecParallelFinish(ParallelExecutorInfo *pei);
extern void ExecParallelCleanup(ParallelExecutorInfo *pei);
extern void ExecParallelReinitialize(PlanState *planstate,

View File

@ -24,8 +24,7 @@ typedef struct TupleQueueReader TupleQueueReader;
extern DestReceiver *CreateTupleQueueDestReceiver(shm_mq_handle *handle);
/* Use these to receive tuples from a shm_mq. */
extern TupleQueueReader *CreateTupleQueueReader(shm_mq_handle *handle,
TupleDesc tupledesc);
extern TupleQueueReader *CreateTupleQueueReader(shm_mq_handle *handle);
extern void DestroyTupleQueueReader(TupleQueueReader *reader);
extern HeapTuple TupleQueueReaderNext(TupleQueueReader *reader,
bool nowait, bool *done);