/* *TheBRINopclassesmayregisterserializationcallback,incasetheon-disk *andin-memoryrepresentationsdiffer(e.g.forperformancereasons).
*/ typedefvoid (*brin_serialize_callback_type) (BrinDesc *bdesc, Datum src, Datum *dst);
/* *ABRINindexstoresoneindextupleperpagerange.Eachindextuple *hasoneBrinValuesstructforeachindexedcolumn;inturn,eachBrinValues *has(besidesthenullflags)anarrayofDatumwhosesizeisdeterminedby *theopclass.
*/ typedefstruct BrinValues
{
AttrNumber bv_attno; /* index attribute number */ bool bv_hasnulls; /* are there any nulls in the page range? */ bool bv_allnulls; /* are all values nulls in the page range? */
Datum *bv_values; /* current accumulated values */
Datum bv_mem_value; /* expanded accumulated values */
MemoryContext bv_context;
brin_serialize_callback_type bv_serialize;
} BrinValues;
/* *Thisstructisusedtorepresentanin-memoryindextuple.Thevaluescan *onlybemeaningfullydecodedwithanappropriateBrinDesc.
*/ typedefstruct BrinMemTuple
{ bool bt_placeholder; /* this is a placeholder tuple */ bool bt_empty_range; /* range represents no tuples */
BlockNumber bt_blkno; /* heap blkno that the tuple is for */
MemoryContext bt_context; /* memcxt holding the bt_columns values */ /* output arrays for brin_deform_tuple: */
Datum *bt_values; /* values array */ bool *bt_allnulls; /* allnulls array */ bool *bt_hasnulls; /* hasnulls array */ /* not an output array, but must be last */
BrinValues bt_columns[FLEXIBLE_ARRAY_MEMBER];
} BrinMemTuple;
/* *Anon-diskBRINtuple.Thisispossiblyfollowedbyanullsbitmask,with *roomfor2nullbits(twobitsforeachindexedcolumn);anopclass-defined *numberofDatumvaluesforeachcolumnfollow.
*/ typedefstruct BrinTuple
{ /* heap block number that the tuple is for */
BlockNumber bt_blkno;