1641 OffsetNumber i, maxoff;
1642 GIDX *unionL = NULL;
1643 GIDX *unionR = NULL;
1646 POSTGIS_DEBUG(4,
"[GIST] in fallback picksplit function");
1648 maxoff = entryvec->n - 1;
1650 nbytes = (maxoff + 2) *
sizeof(OffsetNumber);
1651 v->spl_left = (OffsetNumber*) palloc(nbytes);
1652 v->spl_right = (OffsetNumber*) palloc(nbytes);
1653 v->spl_nleft = v->spl_nright = 0;
1655 for (i = FirstOffsetNumber; i <= maxoff; i = OffsetNumberNext(i))
1657 GIDX *
cur = (GIDX*)DatumGetPointer(entryvec->vector[i].key);
1659 if (i <= (maxoff - FirstOffsetNumber + 1) / 2)
1661 v->spl_left[v->spl_nleft] = i;
1674 v->spl_right[v->spl_nright] = i;
1687 if (v->spl_ldatum_exists)
1688 gidx_merge(&unionL, (GIDX*)DatumGetPointer(v->spl_ldatum));
1690 v->spl_ldatum = PointerGetDatum(unionL);
1692 if (v->spl_rdatum_exists)
1693 gidx_merge(&unionR, (GIDX*)DatumGetPointer(v->spl_rdatum));
1695 v->spl_rdatum = PointerGetDatum(unionR);
1696 v->spl_ldatum_exists = v->spl_rdatum_exists =
false;
static void gidx_merge(GIDX **b_union, GIDX *b_new)
static GIDX * gidx_copy(GIDX *b)