{
GISTENTRY *entry = (GISTENTRY *) PG_GETARG_POINTER(0);
GBT_VARKEY *key = (GBT_VARKEY *) DatumGetPointer(entry->key);
- void *qtst = (void *) DatumGetPointer(PG_GETARG_DATUM(1));
+ void *qtst = (void *) PG_GETARG_POINTER(1);
void *query = (void *) DatumGetByteaP(PG_GETARG_DATUM(1));
StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
bool retval = FALSE;
Datum
gbt_bit_penalty(PG_FUNCTION_ARGS)
{
- float *result = (float *) PG_GETARG_POINTER(2);
GISTENTRY *o = (GISTENTRY *) PG_GETARG_POINTER(0);
GISTENTRY *n = (GISTENTRY *) PG_GETARG_POINTER(1);
+ float *result = (float *) PG_GETARG_POINTER(2);
PG_RETURN_POINTER(gbt_var_penalty(result, o, n, &tinfo));
}
{
GISTENTRY *entry = (GISTENTRY *) PG_GETARG_POINTER(0);
GBT_VARKEY *key = (GBT_VARKEY *) DatumGetPointer(entry->key);
- void *qtst = (void *) DatumGetPointer(PG_GETARG_DATUM(1));
+ void *qtst = (void *) PG_GETARG_POINTER(1);
void *query = (void *) DatumGetByteaP(PG_GETARG_DATUM(1));
StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
bool retval = FALSE;
Datum
gbt_bytea_penalty(PG_FUNCTION_ARGS)
{
- float *result = (float *) PG_GETARG_POINTER(2);
GISTENTRY *o = (GISTENTRY *) PG_GETARG_POINTER(0);
GISTENTRY *n = (GISTENTRY *) PG_GETARG_POINTER(1);
+ float *result = (float *) PG_GETARG_POINTER(2);
PG_RETURN_POINTER(gbt_var_penalty(result, o, n, &tinfo));
}
GISTENTRY *entry = (GISTENTRY *) PG_GETARG_POINTER(0);
GBT_VARKEY *key = (GBT_VARKEY *) DatumGetPointer(entry->key);
- void *qtst = (void *) DatumGetPointer(PG_GETARG_DATUM(1));
+ void *qtst = (void *) PG_GETARG_POINTER(1);
void *query = (void *) DatumGetNumeric(PG_GETARG_DATUM(1));
StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
bool retval = FALSE;
{
GISTENTRY *entry = (GISTENTRY *) PG_GETARG_POINTER(0);
GBT_VARKEY *key = (GBT_VARKEY *) DatumGetPointer(entry->key);
- void *qtst = (void *) DatumGetPointer(PG_GETARG_DATUM(1));
+ void *qtst = (void *) PG_GETARG_POINTER(1);
void *query = (void *) DatumGetTextP(PG_GETARG_DATUM(1));
StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
bool retval = FALSE;
{
GISTENTRY *entry = (GISTENTRY *) PG_GETARG_POINTER(0);
GBT_VARKEY *key = (GBT_VARKEY *) DatumGetPointer(entry->key);
- void *qtst = (void *) DatumGetPointer(PG_GETARG_DATUM(1));
+ void *qtst = (void *) PG_GETARG_POINTER(1);
void *query = (void *) DatumGetPointer(PG_DETOAST_DATUM(PG_GETARG_DATUM(1)));
void *trim = (void *) DatumGetPointer(DirectFunctionCall1(rtrim1, PointerGetDatum(query)));
StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
Datum
gbt_text_penalty(PG_FUNCTION_ARGS)
{
- float *result = (float *) PG_GETARG_POINTER(2);
GISTENTRY *o = (GISTENTRY *) PG_GETARG_POINTER(0);
GISTENTRY *n = (GISTENTRY *) PG_GETARG_POINTER(1);
+ float *result = (float *) PG_GETARG_POINTER(2);
PG_RETURN_POINTER(gbt_var_penalty(result, o, n, &tinfo));
}
#include "btree_utils_num.h"
#include "utils/date.h"
-extern GISTENTRY *
+GISTENTRY *
gbt_num_compress(GISTENTRY *retval, GISTENTRY *entry, const gbtree_ninfo * tinfo)
{
** The GiST union method for numerical values
*/
-extern void *
+void *
gbt_num_union(GBT_NUMKEY * out, const GistEntryVector *entryvec, const gbtree_ninfo * tinfo)
{
int i,
** The GiST same method for numerical values
*/
-extern bool
+bool
gbt_num_same(const GBT_NUMKEY * a, const GBT_NUMKEY * b, const gbtree_ninfo * tinfo)
{
}
-extern void
+void
gbt_num_bin_union(Datum *u, GBT_NUMKEY * e, const gbtree_ninfo * tinfo)
{
** The GiST consistent method
*/
-extern bool
+bool
gbt_num_consistent(
const GBT_NUMKEY_R * key,
const void *query,
}
/* Returns a better readable representaion of variable key ( sets pointer ) */
-
-extern GBT_VARKEY_R
+GBT_VARKEY_R
gbt_var_key_readable(const GBT_VARKEY * k)
{
}
-extern GBT_VARKEY *
+GBT_VARKEY *
gbt_var_key_copy(const GBT_VARKEY_R * u, bool force_node)
{
-extern void
+void
gbt_var_bin_union(Datum *u, GBT_VARKEY * e, const gbtree_vinfo * tinfo)
{
-extern GISTENTRY *
+GISTENTRY *
gbt_var_compress(GISTENTRY *entry, const gbtree_vinfo * tinfo)
{
-extern GBT_VARKEY *
+GBT_VARKEY *
gbt_var_union(const GistEntryVector *entryvec, int32 *size, const gbtree_vinfo * tinfo)
{
}
-extern bool
+bool
gbt_var_same(bool *result, const Datum d1, const Datum d2, const gbtree_vinfo * tinfo)
{
-extern float *
+float *
gbt_var_penalty(float *res, const GISTENTRY *o, const GISTENTRY *n, const gbtree_vinfo * tinfo)
{
return (*gbt_vsrt_cmp_tinfo->f_cmp) (ar.lower, br.lower);
}
-extern GIST_SPLITVEC *
+GIST_SPLITVEC *
gbt_var_picksplit(const GistEntryVector *entryvec, GIST_SPLITVEC *v, const gbtree_vinfo * tinfo)
{
OffsetNumber i,
/*
* The GiST consistent method
*/
-extern bool
+bool
gbt_var_consistent(
GBT_VARKEY_R * key,
const void *query,
cd ./bench
1. createdb TEST
- 2. psql TEST < ../box.sql
+ 2. psql TEST < ../rtree_gist.sql
3. ./create_test.pl | psql TEST
-- change $NUM - number of rows in test dataset
4. ./bench.pl - perl script to benchmark queries.