Files
postgresql/src/include/executor/tqueue.h
Thomas Munro cdc7169509 Use MinimalTuple for tuple queues.
This representation saves 8 bytes per tuple compared to HeapTuple, and
avoids the need to allocate, copy and free on the receiving side.

Gather can emit the returned MinimalTuple directly, but GatherMerge now
needs to make an explicit copy because it buffers multiple tuples at a
time.  That should be no worse than before.

Reviewed-by: Soumyadeep Chakraborty <soumyadeep2007@gmail.com>
Discussion: https://postgr.es/m/CA%2BhUKG%2B8T_ggoUTAE-U%3DA%2BOcPc4%3DB0nPPHcSfffuQhvXXjML6w%40mail.gmail.com
2020-07-17 15:04:16 +12:00

33 lines
1.0 KiB
C

/*-------------------------------------------------------------------------
*
* tqueue.h
* Use shm_mq to send & receive tuples between parallel backends
*
* Portions Copyright (c) 1996-2020, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/executor/tqueue.h
*
*-------------------------------------------------------------------------
*/
#ifndef TQUEUE_H
#define TQUEUE_H
#include "storage/shm_mq.h"
#include "tcop/dest.h"
/* Opaque struct, only known inside tqueue.c. */
typedef struct TupleQueueReader TupleQueueReader;
/* Use this to send tuples to a shm_mq. */
extern DestReceiver *CreateTupleQueueDestReceiver(shm_mq_handle *handle);
/* Use these to receive tuples from a shm_mq. */
extern TupleQueueReader *CreateTupleQueueReader(shm_mq_handle *handle);
extern void DestroyTupleQueueReader(TupleQueueReader *reader);
extern MinimalTuple TupleQueueReaderNext(TupleQueueReader *reader,
bool nowait, bool *done);
#endif /* TQUEUE_H */