2488 BOX2DF *bounds_2df = NULL;
2489 GIDX *bounds_gidx = NULL;
2494 OffsetNumber offset;
2495 unsigned long offset_max;
2500 idx_rel = index_open(idx_oid, AccessShareLock);
2501 buffer = ReadBuffer(idx_rel, GIST_ROOT_BLKNO);
2502 page = (Page) BufferGetPage(
buffer);
2503 offset = FirstOffsetNumber;
2504 offset_max = PageGetMaxOffsetNumber(page);
2505 while (offset <= offset_max)
2507 ItemId iid = PageGetItemId(page, offset);
2512 index_close(idx_rel, AccessShareLock);
2515 ituple = (IndexTuple) PageGetItem(page, iid);
2516 if (!GistTupleIsInvalid(ituple))
2519 Datum idx_attr = index_getattr(ituple, 1, idx_rel->rd_att, &isnull);
2524 BOX2DF *b = (BOX2DF*)DatumGetPointer(idx_attr);
2532 GIDX *b = (GIDX*)DatumGetPointer(idx_attr);
2544 index_close(idx_rel, AccessShareLock);
2558 gbox_from_gidx(bounds_gidx, gbox, 0);
GBOX * gbox_new(uint8_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)