源码分析-TupleTableSlot

PostgreSQL12对比PostgreSQL11,无论在功能上和代码上都有很大的变化,下面分析一下TupleTableSlot这个数据结构在两个版本的不同

首先看看数据结构
PostgreSQL11.5

typedef struct TupleTableSlot
{
   
	NodeTag		type;
	bool		tts_isempty;	/* true = slot is empty */
	bool		tts_shouldFree; /* should pfree tts_tuple? */
	bool		tts_shouldFreeMin;	/* should pfree tts_mintuple? */
#define FIELDNO_TUPLETABLESLOT_SLOW 4
	bool		tts_slow;		/* saved state for slot_deform_tuple */
#define FIELDNO_TUPLETABLESLOT_TUPLE 5
	HeapTuple	tts_tuple;		/* physical tuple, or NULL if virtual */
#define FIELDNO_TUPLETABLESLOT_TUPLEDESCRIPTOR 6
	TupleDesc	tts_tupleDescriptor;	/* slot's tuple descriptor */
	MemoryContext tts_mcxt;		/* slot itself is in this context */
	Buffer		tts_buffer;		/* tuple's buffer, or InvalidBuffer */
#define FIELDNO_TUPLETABLESLOT_NVALID 9
	int			tts_nvalid;		/* # of valid values in tts_values */
#define FIELDNO_TUPLETABLESLOT_VALUES 10
	Datum	   *tts_values;		/* current per-attribute values */
#define FIELDNO_TUPLETABLESLOT_ISNULL 11
	bool	   *tts_isnull;		/* current per-attribute isnull flags */
	MinimalTuple tts_mintuple;	/* minimal tuple, or NULL if none */
	HeapTupleData tts_minhdr;	/* workspace for minimal-tuple-only case */
#define FIELDNO_TUPLETABLESLOT_OFF 14
	uint32		tts_off;		/* saved state for slot_deform_tuple */
	bool		tts_fixedTupleDescriptor;	/* descriptor can't be changed */
} TupleTableSlot;

PostgreSQL12.1

typedef struct TupleTableSlot
{
   
	NodeTag		type;
#define FIELDNO_TUPLETABLESLOT_FLAGS 1
	uint16		tts_flags;		/* Boolean states */
#define FIELDNO_TUPLETABLESLOT_NVALID 2
	AttrNumber	tts_nvalid;		/* # of valid values in tts
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值