1642 OffsetNumber i, maxoff;
1643 GIDX *unionL = NULL;
1644 GIDX *unionR = NULL;
1647 POSTGIS_DEBUG(4,
"[GIST] in fallback picksplit function");
1649 maxoff = entryvec->n - 1;
1651 nbytes = (maxoff + 2) *
sizeof(OffsetNumber);
1652 v->spl_left = (OffsetNumber*) palloc(nbytes);
1653 v->spl_right = (OffsetNumber*) palloc(nbytes);
1654 v->spl_nleft = v->spl_nright = 0;
1656 for (i = FirstOffsetNumber; i <= maxoff; i = OffsetNumberNext(i))
1658 GIDX *
cur = (GIDX*)DatumGetPointer(entryvec->vector[i].key);
1660 if (i <= (maxoff - FirstOffsetNumber + 1) / 2)
1662 v->spl_left[v->spl_nleft] = i;
1675 v->spl_right[v->spl_nright] = i;
1688 if (v->spl_ldatum_exists)
1689 gidx_merge(&unionL, (GIDX*)DatumGetPointer(v->spl_ldatum));
1691 v->spl_ldatum = PointerGetDatum(unionL);
1693 if (v->spl_rdatum_exists)
1694 gidx_merge(&unionR, (GIDX*)DatumGetPointer(v->spl_rdatum));
1696 v->spl_rdatum = PointerGetDatum(unionR);
1697 v->spl_ldatum_exists = v->spl_rdatum_exists =
false;
GIDX * gidx_copy(GIDX *b)
void gidx_merge(GIDX **b_union, GIDX *b_new)