1420 OffsetNumber i, maxoff;
1421 GIDX *unionL = NULL;
1422 GIDX *unionR = NULL;
1425 POSTGIS_DEBUG(4,
"[GIST] in fallback picksplit function");
1427 maxoff = entryvec->n - 1;
1429 nbytes = (maxoff + 2) *
sizeof(OffsetNumber);
1430 v->spl_left = (OffsetNumber *)palloc(nbytes);
1431 v->spl_right = (OffsetNumber *)palloc(nbytes);
1432 v->spl_nleft = v->spl_nright = 0;
1434 for (i = FirstOffsetNumber; i <= maxoff; i = OffsetNumberNext(i))
1436 GIDX *
cur = (GIDX *)DatumGetPointer(entryvec->vector[i].key);
1438 if (i <= (maxoff - FirstOffsetNumber + 1) / 2)
1440 v->spl_left[v->spl_nleft] = i;
1449 v->spl_right[v->spl_nright] = i;
1458 if (v->spl_ldatum_exists)
1459 gidx_merge(&unionL, (GIDX *)DatumGetPointer(v->spl_ldatum));
1461 v->spl_ldatum = PointerGetDatum(unionL);
1463 if (v->spl_rdatum_exists)
1464 gidx_merge(&unionR, (GIDX *)DatumGetPointer(v->spl_rdatum));
1466 v->spl_rdatum = PointerGetDatum(unionR);
1467 v->spl_ldatum_exists = v->spl_rdatum_exists =
false;
GIDX * gidx_copy(GIDX *b)
void gidx_merge(GIDX **b_union, GIDX *b_new)