2502 BOX2DF *bounds_2df = NULL;
2503 GIDX *bounds_gidx = NULL;
2508 OffsetNumber offset;
2509 unsigned long offset_max;
2514 idx_rel = index_open(idx_oid, AccessShareLock);
2515 buffer = ReadBuffer(idx_rel, GIST_ROOT_BLKNO);
2516 page = (Page) BufferGetPage(
buffer);
2517 offset = FirstOffsetNumber;
2518 offset_max = PageGetMaxOffsetNumber(page);
2519 while (offset <= offset_max)
2521 ItemId iid = PageGetItemId(page, offset);
2526 index_close(idx_rel, AccessShareLock);
2529 ituple = (IndexTuple) PageGetItem(page, iid);
2530 if (!GistTupleIsInvalid(ituple))
2533 Datum idx_attr = index_getattr(ituple, att_num, idx_rel->rd_att, &isnull);
2538 BOX2DF *b = (BOX2DF*)DatumGetPointer(idx_attr);
2546 GIDX *b = (GIDX*)DatumGetPointer(idx_attr);
2558 index_close(idx_rel, AccessShareLock);
2572 gbox_from_gidx(bounds_gidx, gbox, 0);
GBOX * gbox_new(lwflags_t flags)
Create a new gbox with the dimensionality indicated by the flags.
#define STATISTIC_SLOT_ND
#define STATISTIC_SLOT_2D
void box2df_merge(BOX2DF *b_union, BOX2DF *b_new)
bool box2df_is_empty(const BOX2DF *a)
int box2df_to_gbox_p(BOX2DF *a, GBOX *box)
BOX2DF * box2df_copy(BOX2DF *b)
bool gidx_is_unknown(const GIDX *a)
GIDX * gidx_copy(GIDX *b)
void gidx_merge(GIDX **b_union, GIDX *b_new)
Datum buffer(PG_FUNCTION_ARGS)