PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
brin_tuple.h File Reference
Include dependency graph for brin_tuple.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  BrinValues
 
struct  BrinMemTuple
 
struct  BrinTuple
 

Macros

#define SizeOfBrinTuple   (offsetof(BrinTuple, bt_info) + sizeof(uint8))
 
#define BRIN_OFFSET_MASK   0x1F
 
#define BRIN_PLACEHOLDER_MASK   0x40
 
#define BRIN_NULLS_MASK   0x80
 
#define BrinTupleDataOffset(tup)   ((Size) (((BrinTuple *) (tup))->bt_info & BRIN_OFFSET_MASK))
 
#define BrinTupleHasNulls(tup)   (((((BrinTuple *) (tup))->bt_info & BRIN_NULLS_MASK)) != 0)
 
#define BrinTupleIsPlaceholder(tup)   (((((BrinTuple *) (tup))->bt_info & BRIN_PLACEHOLDER_MASK)) != 0)
 

Typedefs

typedef struct BrinValues BrinValues
 
typedef struct BrinMemTuple BrinMemTuple
 
typedef struct BrinTuple BrinTuple
 

Functions

BrinTuplebrin_form_tuple (BrinDesc *brdesc, BlockNumber blkno, BrinMemTuple *tuple, Size *size)
 
BrinTuplebrin_form_placeholder_tuple (BrinDesc *brdesc, BlockNumber blkno, Size *size)
 
void brin_free_tuple (BrinTuple *tuple)
 
BrinTuplebrin_copy_tuple (BrinTuple *tuple, Size len)
 
bool brin_tuples_equal (const BrinTuple *a, Size alen, const BrinTuple *b, Size blen)
 
BrinMemTuplebrin_new_memtuple (BrinDesc *brdesc)
 
void brin_memtuple_initialize (BrinMemTuple *dtuple, BrinDesc *brdesc)
 
BrinMemTuplebrin_deform_tuple (BrinDesc *brdesc, BrinTuple *tuple)
 

Macro Definition Documentation

#define BRIN_NULLS_MASK   0x80

Definition at line 74 of file brin_tuple.h.

Referenced by brin_form_placeholder_tuple(), and brin_form_tuple().

#define BRIN_OFFSET_MASK   0x1F

Definition at line 71 of file brin_tuple.h.

Referenced by brin_form_tuple().

#define BRIN_PLACEHOLDER_MASK   0x40

Definition at line 73 of file brin_tuple.h.

Referenced by brin_form_placeholder_tuple(), and brin_form_tuple().

#define BrinTupleDataOffset (   tup)    ((Size) (((BrinTuple *) (tup))->bt_info & BRIN_OFFSET_MASK))

Definition at line 76 of file brin_tuple.h.

Referenced by brin_deform_tuple().

#define BrinTupleHasNulls (   tup)    (((((BrinTuple *) (tup))->bt_info & BRIN_NULLS_MASK)) != 0)

Definition at line 77 of file brin_tuple.h.

Referenced by brin_deform_tuple().

#define BrinTupleIsPlaceholder (   tup)    (((((BrinTuple *) (tup))->bt_info & BRIN_PLACEHOLDER_MASK)) != 0)

Definition at line 78 of file brin_tuple.h.

Referenced by brin_deform_tuple().

#define SizeOfBrinTuple   (offsetof(BrinTuple, bt_info) + sizeof(uint8))

Definition at line 66 of file brin_tuple.h.

Referenced by brin_deform_tuple(), brin_form_placeholder_tuple(), and brin_form_tuple().

Typedef Documentation

Function Documentation

BrinTuple* brin_copy_tuple ( BrinTuple tuple,
Size  len 
)

Definition at line 317 of file brin_tuple.c.

References palloc().

Referenced by brin_evacuate_page(), bringetbitmap(), brininsert(), and summarize_range().

318 {
319  BrinTuple *newtup;
320 
321  newtup = palloc(len);
322  memcpy(newtup, tuple, len);
323 
324  return newtup;
325 }
void * palloc(Size size)
Definition: mcxt.c:891
BrinMemTuple* brin_deform_tuple ( BrinDesc brdesc,
BrinTuple tuple 
)

Definition at line 398 of file brin_tuple.c.

References BrinDesc::bd_info, BrinDesc::bd_totalstored, BrinDesc::bd_tupdesc, brin_deconstruct_tuple(), brin_new_memtuple(), BrinTupleDataOffset, BrinTupleHasNulls, BrinTupleIsPlaceholder, BrinMemTuple::bt_blkno, BrinTuple::bt_blkno, BrinMemTuple::bt_columns, BrinMemTuple::bt_context, BrinMemTuple::bt_placeholder, BrinValues::bv_allnulls, BrinValues::bv_hasnulls, BrinValues::bv_values, datumCopy(), i, MemoryContextSwitchTo(), tupleDesc::natts, NULL, BrinOpcInfo::oi_nstored, BrinOpcInfo::oi_typcache, palloc(), pfree(), SizeOfBrinTuple, TypeCacheEntry::typbyval, TypeCacheEntry::typlen, and values.

Referenced by brin_page_items(), bringetbitmap(), brininsert(), and union_tuples().

399 {
400  BrinMemTuple *dtup;
401  Datum *values;
402  bool *allnulls;
403  bool *hasnulls;
404  char *tp;
405  bits8 *nullbits;
406  int keyno;
407  int valueno;
408  MemoryContext oldcxt;
409 
410  dtup = brin_new_memtuple(brdesc);
411 
412  if (BrinTupleIsPlaceholder(tuple))
413  dtup->bt_placeholder = true;
414  dtup->bt_blkno = tuple->bt_blkno;
415 
416  values = palloc(sizeof(Datum) * brdesc->bd_totalstored);
417  allnulls = palloc(sizeof(bool) * brdesc->bd_tupdesc->natts);
418  hasnulls = palloc(sizeof(bool) * brdesc->bd_tupdesc->natts);
419 
420  tp = (char *) tuple + BrinTupleDataOffset(tuple);
421 
422  if (BrinTupleHasNulls(tuple))
423  nullbits = (bits8 *) ((char *) tuple + SizeOfBrinTuple);
424  else
425  nullbits = NULL;
426  brin_deconstruct_tuple(brdesc,
427  tp, nullbits, BrinTupleHasNulls(tuple),
428  values, allnulls, hasnulls);
429 
430  /*
431  * Iterate to assign each of the values to the corresponding item in the
432  * values array of each column. The copies occur in the tuple's context.
433  */
434  oldcxt = MemoryContextSwitchTo(dtup->bt_context);
435  for (valueno = 0, keyno = 0; keyno < brdesc->bd_tupdesc->natts; keyno++)
436  {
437  int i;
438 
439  if (allnulls[keyno])
440  {
441  valueno += brdesc->bd_info[keyno]->oi_nstored;
442  continue;
443  }
444 
445  /*
446  * We would like to skip datumCopy'ing the values datum in some cases,
447  * caller permitting ...
448  */
449  for (i = 0; i < brdesc->bd_info[keyno]->oi_nstored; i++)
450  dtup->bt_columns[keyno].bv_values[i] =
451  datumCopy(values[valueno++],
452  brdesc->bd_info[keyno]->oi_typcache[i]->typbyval,
453  brdesc->bd_info[keyno]->oi_typcache[i]->typlen);
454 
455  dtup->bt_columns[keyno].bv_hasnulls = hasnulls[keyno];
456  dtup->bt_columns[keyno].bv_allnulls = false;
457  }
458 
459  MemoryContextSwitchTo(oldcxt);
460 
461  pfree(values);
462  pfree(allnulls);
463  pfree(hasnulls);
464 
465  return dtup;
466 }
#define BrinTupleIsPlaceholder(tup)
Definition: brin_tuple.h:78
#define SizeOfBrinTuple
Definition: brin_tuple.h:66
#define BrinTupleHasNulls(tup)
Definition: brin_tuple.h:77
BlockNumber bt_blkno
Definition: brin_tuple.h:39
bool bv_allnulls
Definition: brin_tuple.h:28
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
Definition: palloc.h:109
BrinMemTuple * brin_new_memtuple(BrinDesc *brdesc)
Definition: brin_tuple.c:348
int16 typlen
Definition: typcache.h:35
bool typbyval
Definition: typcache.h:36
int natts
Definition: tupdesc.h:73
void pfree(void *pointer)
Definition: mcxt.c:992
bool bt_placeholder
Definition: brin_tuple.h:38
bool bv_hasnulls
Definition: brin_tuple.h:27
TypeCacheEntry * oi_typcache[FLEXIBLE_ARRAY_MEMBER]
Definition: brin_internal.h:34
uint16 oi_nstored
Definition: brin_internal.h:28
int bd_totalstored
Definition: brin_internal.h:56
static void brin_deconstruct_tuple(BrinDesc *brdesc, char *tp, bits8 *nullbits, bool nulls, Datum *values, bool *allnulls, bool *hasnulls)
Definition: brin_tuple.c:484
BrinValues bt_columns[FLEXIBLE_ARRAY_MEMBER]
Definition: brin_tuple.h:41
TupleDesc bd_tupdesc
Definition: brin_internal.h:50
Datum datumCopy(Datum value, bool typByVal, int typLen)
Definition: datum.c:128
uint8 bits8
Definition: c.h:272
uintptr_t Datum
Definition: postgres.h:374
BrinOpcInfo * bd_info[FLEXIBLE_ARRAY_MEMBER]
Definition: brin_internal.h:59
BlockNumber bt_blkno
Definition: brin_tuple.h:52
#define NULL
Definition: c.h:226
static Datum values[MAXATTR]
Definition: bootstrap.c:162
void * palloc(Size size)
Definition: mcxt.c:891
#define BrinTupleDataOffset(tup)
Definition: brin_tuple.h:76
int i
Datum * bv_values
Definition: brin_tuple.h:29
MemoryContext bt_context
Definition: brin_tuple.h:40
BrinTuple* brin_form_placeholder_tuple ( BrinDesc brdesc,
BlockNumber  blkno,
Size size 
)

Definition at line 263 of file brin_tuple.c.

References BrinDesc::bd_tupdesc, BITMAPLEN, BRIN_NULLS_MASK, BRIN_PLACEHOLDER_MASK, BrinTuple::bt_blkno, BrinTuple::bt_info, HIGHBIT, MAXALIGN, tupleDesc::natts, palloc0(), and SizeOfBrinTuple.

Referenced by summarize_range().

264 {
265  Size len;
266  Size hoff;
267  BrinTuple *rettuple;
268  int keyno;
269  bits8 *bitP;
270  int bitmask;
271 
272  /* compute total space needed: always add nulls */
273  len = SizeOfBrinTuple;
274  len += BITMAPLEN(brdesc->bd_tupdesc->natts * 2);
275  len = hoff = MAXALIGN(len);
276 
277  rettuple = palloc0(len);
278  rettuple->bt_blkno = blkno;
279  rettuple->bt_info = hoff;
281 
282  bitP = ((bits8 *) ((char *) rettuple + SizeOfBrinTuple)) - 1;
283  bitmask = HIGHBIT;
284  /* set allnulls true for all attributes */
285  for (keyno = 0; keyno < brdesc->bd_tupdesc->natts; keyno++)
286  {
287  if (bitmask != HIGHBIT)
288  bitmask <<= 1;
289  else
290  {
291  bitP += 1;
292  *bitP = 0x0;
293  bitmask = 1;
294  }
295 
296  *bitP |= bitmask;
297  }
298  /* no need to set hasnulls */
299 
300  *size = len;
301  return rettuple;
302 }
#define SizeOfBrinTuple
Definition: brin_tuple.h:66
#define BITMAPLEN(NATTS)
Definition: htup_details.h:548
int natts
Definition: tupdesc.h:73
#define BRIN_NULLS_MASK
Definition: brin_tuple.h:74
TupleDesc bd_tupdesc
Definition: brin_internal.h:50
#define HIGHBIT
Definition: c.h:968
#define BRIN_PLACEHOLDER_MASK
Definition: brin_tuple.h:73
uint8 bits8
Definition: c.h:272
void * palloc0(Size size)
Definition: mcxt.c:920
BlockNumber bt_blkno
Definition: brin_tuple.h:52
size_t Size
Definition: c.h:353
#define MAXALIGN(LEN)
Definition: c.h:584
uint8 bt_info
Definition: brin_tuple.h:63
BrinTuple* brin_form_tuple ( BrinDesc brdesc,
BlockNumber  blkno,
BrinMemTuple tuple,
Size size 
)

Definition at line 89 of file brin_tuple.c.

References Assert, BrinDesc::bd_info, BrinDesc::bd_totalstored, BrinDesc::bd_tupdesc, BITMAPLEN, BRIN_NULLS_MASK, BRIN_OFFSET_MASK, BRIN_PLACEHOLDER_MASK, brtuple_disk_tupdesc(), BrinTuple::bt_blkno, BrinMemTuple::bt_columns, BrinTuple::bt_info, BrinMemTuple::bt_placeholder, BrinValues::bv_allnulls, BrinValues::bv_hasnulls, BrinValues::bv_values, heap_compute_data_size(), heap_fill_tuple(), HIGHBIT, MAXALIGN, tupleDesc::natts, BrinOpcInfo::oi_nstored, palloc(), palloc0(), pfree(), SizeOfBrinTuple, and values.

Referenced by brininsert(), form_and_insert_tuple(), and summarize_range().

91 {
92  Datum *values;
93  bool *nulls;
94  bool anynulls = false;
95  BrinTuple *rettuple;
96  int keyno;
97  int idxattno;
98  uint16 phony_infomask = 0;
99  bits8 *phony_nullbitmap;
100  Size len,
101  hoff,
102  data_len;
103 
104  Assert(brdesc->bd_totalstored > 0);
105 
106  values = (Datum *) palloc(sizeof(Datum) * brdesc->bd_totalstored);
107  nulls = (bool *) palloc0(sizeof(bool) * brdesc->bd_totalstored);
108  phony_nullbitmap = (bits8 *)
109  palloc(sizeof(bits8) * BITMAPLEN(brdesc->bd_totalstored));
110 
111  /*
112  * Set up the values/nulls arrays for heap_fill_tuple
113  */
114  idxattno = 0;
115  for (keyno = 0; keyno < brdesc->bd_tupdesc->natts; keyno++)
116  {
117  int datumno;
118 
119  /*
120  * "allnulls" is set when there's no nonnull value in any row in the
121  * column; when this happens, there is no data to store. Thus set the
122  * nullable bits for all data elements of this column and we're done.
123  */
124  if (tuple->bt_columns[keyno].bv_allnulls)
125  {
126  for (datumno = 0;
127  datumno < brdesc->bd_info[keyno]->oi_nstored;
128  datumno++)
129  nulls[idxattno++] = true;
130  anynulls = true;
131  continue;
132  }
133 
134  /*
135  * The "hasnulls" bit is set when there are some null values in the
136  * data. We still need to store a real value, but the presence of
137  * this means we need a null bitmap.
138  */
139  if (tuple->bt_columns[keyno].bv_hasnulls)
140  anynulls = true;
141 
142  for (datumno = 0;
143  datumno < brdesc->bd_info[keyno]->oi_nstored;
144  datumno++)
145  values[idxattno++] = tuple->bt_columns[keyno].bv_values[datumno];
146  }
147 
148  /* Assert we did not overrun temp arrays */
149  Assert(idxattno <= brdesc->bd_totalstored);
150 
151  /* compute total space needed */
152  len = SizeOfBrinTuple;
153  if (anynulls)
154  {
155  /*
156  * We need a double-length bitmap on an on-disk BRIN index tuple; the
157  * first half stores the "allnulls" bits, the second stores
158  * "hasnulls".
159  */
160  len += BITMAPLEN(brdesc->bd_tupdesc->natts * 2);
161  }
162 
163  len = hoff = MAXALIGN(len);
164 
165  data_len = heap_compute_data_size(brtuple_disk_tupdesc(brdesc),
166  values, nulls);
167  len += data_len;
168 
169  len = MAXALIGN(len);
170 
171  rettuple = palloc0(len);
172  rettuple->bt_blkno = blkno;
173  rettuple->bt_info = hoff;
174 
175  /* Assert that hoff fits in the space available */
176  Assert((rettuple->bt_info & BRIN_OFFSET_MASK) == hoff);
177 
178  /*
179  * The infomask and null bitmap as computed by heap_fill_tuple are useless
180  * to us. However, that function will not accept a null infomask; and we
181  * need to pass a valid null bitmap so that it will correctly skip
182  * outputting null attributes in the data area.
183  */
185  values,
186  nulls,
187  (char *) rettuple + hoff,
188  data_len,
189  &phony_infomask,
190  phony_nullbitmap);
191 
192  /* done with these */
193  pfree(values);
194  pfree(nulls);
195  pfree(phony_nullbitmap);
196 
197  /*
198  * Now fill in the real null bitmasks. allnulls first.
199  */
200  if (anynulls)
201  {
202  bits8 *bitP;
203  int bitmask;
204 
205  rettuple->bt_info |= BRIN_NULLS_MASK;
206 
207  /*
208  * Note that we reverse the sense of null bits in this module: we
209  * store a 1 for a null attribute rather than a 0. So we must reverse
210  * the sense of the att_isnull test in br_deconstruct_tuple as well.
211  */
212  bitP = ((bits8 *) ((char *) rettuple + SizeOfBrinTuple)) - 1;
213  bitmask = HIGHBIT;
214  for (keyno = 0; keyno < brdesc->bd_tupdesc->natts; keyno++)
215  {
216  if (bitmask != HIGHBIT)
217  bitmask <<= 1;
218  else
219  {
220  bitP += 1;
221  *bitP = 0x0;
222  bitmask = 1;
223  }
224 
225  if (!tuple->bt_columns[keyno].bv_allnulls)
226  continue;
227 
228  *bitP |= bitmask;
229  }
230  /* hasnulls bits follow */
231  for (keyno = 0; keyno < brdesc->bd_tupdesc->natts; keyno++)
232  {
233  if (bitmask != HIGHBIT)
234  bitmask <<= 1;
235  else
236  {
237  bitP += 1;
238  *bitP = 0x0;
239  bitmask = 1;
240  }
241 
242  if (!tuple->bt_columns[keyno].bv_hasnulls)
243  continue;
244 
245  *bitP |= bitmask;
246  }
247  bitP = ((bits8 *) (rettuple + SizeOfBrinTuple)) - 1;
248  }
249 
250  if (tuple->bt_placeholder)
251  rettuple->bt_info |= BRIN_PLACEHOLDER_MASK;
252 
253  *size = len;
254  return rettuple;
255 }
#define BRIN_OFFSET_MASK
Definition: brin_tuple.h:71
void heap_fill_tuple(TupleDesc tupleDesc, Datum *values, bool *isnull, char *data, Size data_size, uint16 *infomask, bits8 *bit)
Definition: heaptuple.c:146
#define SizeOfBrinTuple
Definition: brin_tuple.h:66
bool bv_allnulls
Definition: brin_tuple.h:28
#define BITMAPLEN(NATTS)
Definition: htup_details.h:548
int natts
Definition: tupdesc.h:73
unsigned short uint16
Definition: c.h:264
void pfree(void *pointer)
Definition: mcxt.c:992
static TupleDesc brtuple_disk_tupdesc(BrinDesc *brdesc)
Definition: brin_tuple.c:51
bool bt_placeholder
Definition: brin_tuple.h:38
bool bv_hasnulls
Definition: brin_tuple.h:27
uint16 oi_nstored
Definition: brin_internal.h:28
int bd_totalstored
Definition: brin_internal.h:56
BrinValues bt_columns[FLEXIBLE_ARRAY_MEMBER]
Definition: brin_tuple.h:41
#define BRIN_NULLS_MASK
Definition: brin_tuple.h:74
TupleDesc bd_tupdesc
Definition: brin_internal.h:50
#define HIGHBIT
Definition: c.h:968
#define BRIN_PLACEHOLDER_MASK
Definition: brin_tuple.h:73
uint8 bits8
Definition: c.h:272
void * palloc0(Size size)
Definition: mcxt.c:920
uintptr_t Datum
Definition: postgres.h:374
BrinOpcInfo * bd_info[FLEXIBLE_ARRAY_MEMBER]
Definition: brin_internal.h:59
BlockNumber bt_blkno
Definition: brin_tuple.h:52
#define Assert(condition)
Definition: c.h:671
size_t Size
Definition: c.h:353
#define MAXALIGN(LEN)
Definition: c.h:584
Size heap_compute_data_size(TupleDesc tupleDesc, Datum *values, bool *isnull)
Definition: heaptuple.c:85
static Datum values[MAXATTR]
Definition: bootstrap.c:162
uint8 bt_info
Definition: brin_tuple.h:63
void * palloc(Size size)
Definition: mcxt.c:891
Datum * bv_values
Definition: brin_tuple.h:29
void brin_free_tuple ( BrinTuple tuple)

Definition at line 308 of file brin_tuple.c.

References pfree().

Referenced by summarize_range().

309 {
310  pfree(tuple);
311 }
void pfree(void *pointer)
Definition: mcxt.c:992
void brin_memtuple_initialize ( BrinMemTuple dtuple,
BrinDesc brdesc 
)

Definition at line 378 of file brin_tuple.c.

References BrinDesc::bd_tupdesc, BrinMemTuple::bt_columns, BrinMemTuple::bt_context, BrinValues::bv_allnulls, BrinValues::bv_hasnulls, i, MemoryContextReset(), and tupleDesc::natts.

Referenced by brinbuildCallback(), brinsummarize(), and initialize_brin_buildstate().

379 {
380  int i;
381 
383  for (i = 0; i < brdesc->bd_tupdesc->natts; i++)
384  {
385  dtuple->bt_columns[i].bv_allnulls = true;
386  dtuple->bt_columns[i].bv_hasnulls = false;
387  }
388 }
bool bv_allnulls
Definition: brin_tuple.h:28
void MemoryContextReset(MemoryContext context)
Definition: mcxt.c:135
int natts
Definition: tupdesc.h:73
bool bv_hasnulls
Definition: brin_tuple.h:27
BrinValues bt_columns[FLEXIBLE_ARRAY_MEMBER]
Definition: brin_tuple.h:41
TupleDesc bd_tupdesc
Definition: brin_internal.h:50
int i
MemoryContext bt_context
Definition: brin_tuple.h:40
BrinMemTuple* brin_new_memtuple ( BrinDesc brdesc)

Definition at line 348 of file brin_tuple.c.

References ALLOCSET_DEFAULT_SIZES, AllocSetContextCreate(), BrinDesc::bd_info, BrinDesc::bd_totalstored, BrinDesc::bd_tupdesc, BrinMemTuple::bt_columns, BrinMemTuple::bt_context, BrinValues::bv_allnulls, BrinValues::bv_attno, BrinValues::bv_hasnulls, BrinValues::bv_values, CurrentMemoryContext, i, MAXALIGN, tupleDesc::natts, BrinOpcInfo::oi_nstored, and palloc0().

Referenced by brin_deform_tuple(), and initialize_brin_buildstate().

349 {
350  BrinMemTuple *dtup;
351  char *currdatum;
352  long basesize;
353  int i;
354 
355  basesize = MAXALIGN(sizeof(BrinMemTuple) +
356  sizeof(BrinValues) * brdesc->bd_tupdesc->natts);
357  dtup = palloc0(basesize + sizeof(Datum) * brdesc->bd_totalstored);
358  currdatum = (char *) dtup + basesize;
359  for (i = 0; i < brdesc->bd_tupdesc->natts; i++)
360  {
361  dtup->bt_columns[i].bv_attno = i + 1;
362  dtup->bt_columns[i].bv_allnulls = true;
363  dtup->bt_columns[i].bv_hasnulls = false;
364  dtup->bt_columns[i].bv_values = (Datum *) currdatum;
365  currdatum += sizeof(Datum) * brdesc->bd_info[i]->oi_nstored;
366  }
367 
369  "brin dtuple",
371  return dtup;
372 }
bool bv_allnulls
Definition: brin_tuple.h:28
int natts
Definition: tupdesc.h:73
bool bv_hasnulls
Definition: brin_tuple.h:27
#define ALLOCSET_DEFAULT_SIZES
Definition: memutils.h:151
AttrNumber bv_attno
Definition: brin_tuple.h:26
uint16 oi_nstored
Definition: brin_internal.h:28
int bd_totalstored
Definition: brin_internal.h:56
BrinValues bt_columns[FLEXIBLE_ARRAY_MEMBER]
Definition: brin_tuple.h:41
TupleDesc bd_tupdesc
Definition: brin_internal.h:50
MemoryContext CurrentMemoryContext
Definition: mcxt.c:37
MemoryContext AllocSetContextCreate(MemoryContext parent, const char *name, Size minContextSize, Size initBlockSize, Size maxBlockSize)
Definition: aset.c:329
void * palloc0(Size size)
Definition: mcxt.c:920
uintptr_t Datum
Definition: postgres.h:374
BrinOpcInfo * bd_info[FLEXIBLE_ARRAY_MEMBER]
Definition: brin_internal.h:59
#define MAXALIGN(LEN)
Definition: c.h:584
int i
Datum * bv_values
Definition: brin_tuple.h:29
MemoryContext bt_context
Definition: brin_tuple.h:40
bool brin_tuples_equal ( const BrinTuple a,
Size  alen,
const BrinTuple b,
Size  blen 
)

Definition at line 331 of file brin_tuple.c.

Referenced by brin_doupdate().

332 {
333  if (alen != blen)
334  return false;
335  if (memcmp(a, b, alen) != 0)
336  return false;
337  return true;
338 }