mirror of
https://github.com/postgres/postgres.git
synced 2025-06-11 20:28:21 +03:00
Changes
* new split algorithm (as proposed in http://archives.postgresql.org/pgsql-hackers/2006-06/msg00254.php) * possible call pickSplit() for second and below columns * add spl_(l|r)datum_exists to GIST_SPLITVEC - pickSplit should check its values to use already defined spl_(l|r)datum for splitting. pickSplit should set spl_(l|r)datum_exists to 'false' (if they was 'true') to signal to caller about using spl_(l|r)datum. * support for old pickSplit(): not very optimal but correct split * remove 'bytes' field from GISTENTRY: in any case size of value is defined by it's type. * split GIST_SPLITVEC to two structures: one for using in picksplit and second - for internal use. * some code refactoring * support of subsplit to rtree opclasses TODO: add support of subsplit to contrib modules
This commit is contained in:
@ -100,7 +100,7 @@ gbt_inet_compress(PG_FUNCTION_ARGS)
|
||||
r->upper = r->lower;
|
||||
gistentryinit(*retval, PointerGetDatum(r),
|
||||
entry->rel, entry->page,
|
||||
entry->offset, sizeof(inetKEY), FALSE);
|
||||
entry->offset, FALSE);
|
||||
}
|
||||
else
|
||||
retval = entry;
|
||||
|
@ -129,7 +129,7 @@ gbt_intv_compress(PG_FUNCTION_ARGS)
|
||||
}
|
||||
gistentryinit(*retval, PointerGetDatum(r),
|
||||
entry->rel, entry->page,
|
||||
entry->offset, 2 * INTERVALSIZE, FALSE);
|
||||
entry->offset, FALSE);
|
||||
}
|
||||
|
||||
PG_RETURN_POINTER(retval);
|
||||
@ -153,7 +153,7 @@ gbt_intv_decompress(PG_FUNCTION_ARGS)
|
||||
|
||||
gistentryinit(*retval, PointerGetDatum(r),
|
||||
entry->rel, entry->page,
|
||||
entry->offset, sizeof(intvKEY), FALSE);
|
||||
entry->offset, FALSE);
|
||||
}
|
||||
PG_RETURN_POINTER(retval);
|
||||
}
|
||||
|
@ -115,7 +115,7 @@ gbt_bpchar_compress(PG_FUNCTION_ARGS)
|
||||
|
||||
gistentryinit(trim, d,
|
||||
entry->rel, entry->page,
|
||||
entry->offset, VARSIZE(DatumGetPointer(d)), TRUE);
|
||||
entry->offset, TRUE);
|
||||
retval = gbt_var_compress(&trim, &tinfo);
|
||||
}
|
||||
else
|
||||
|
@ -137,7 +137,7 @@ gbt_timetz_compress(PG_FUNCTION_ARGS)
|
||||
r->lower = r->upper = tmp;
|
||||
gistentryinit(*retval, PointerGetDatum(r),
|
||||
entry->rel, entry->page,
|
||||
entry->offset, sizeof(timeKEY), FALSE);
|
||||
entry->offset, FALSE);
|
||||
}
|
||||
else
|
||||
retval = entry;
|
||||
|
@ -159,7 +159,7 @@ gbt_tstz_compress(PG_FUNCTION_ARGS)
|
||||
r->lower = r->upper = gmt;
|
||||
gistentryinit(*retval, PointerGetDatum(r),
|
||||
entry->rel, entry->page,
|
||||
entry->offset, sizeof(tsKEY), FALSE);
|
||||
entry->offset, FALSE);
|
||||
}
|
||||
else
|
||||
retval = entry;
|
||||
|
@ -46,7 +46,7 @@ gbt_num_compress(GISTENTRY *retval, GISTENTRY *entry, const gbtree_ninfo * tinfo
|
||||
memcpy((void *) &r[tinfo->size], leaf, tinfo->size);
|
||||
retval = palloc(sizeof(GISTENTRY));
|
||||
gistentryinit(*retval, PointerGetDatum(r), entry->rel, entry->page,
|
||||
entry->offset, (2 * tinfo->size), FALSE);
|
||||
entry->offset, FALSE);
|
||||
}
|
||||
else
|
||||
retval = entry;
|
||||
|
@ -19,7 +19,7 @@ gbt_var_decompress(PG_FUNCTION_ARGS)
|
||||
|
||||
gistentryinit(*retval, PointerGetDatum(key),
|
||||
entry->rel, entry->page,
|
||||
entry->offset, VARSIZE(key), FALSE);
|
||||
entry->offset, FALSE);
|
||||
|
||||
PG_RETURN_POINTER(retval);
|
||||
}
|
||||
@ -292,7 +292,7 @@ gbt_var_compress(GISTENTRY *entry, const gbtree_vinfo * tinfo)
|
||||
retval = palloc(sizeof(GISTENTRY));
|
||||
gistentryinit(*retval, PointerGetDatum(r),
|
||||
entry->rel, entry->page,
|
||||
entry->offset, VARSIZE(r), TRUE);
|
||||
entry->offset, TRUE);
|
||||
}
|
||||
else
|
||||
retval = entry;
|
||||
|
Reference in New Issue
Block a user