aboutsummaryrefslogtreecommitdiff
path: root/src/backend
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend')
-rw-r--r--src/backend/access/gist/gistproc.c32
-rw-r--r--src/backend/utils/adt/network_gist.c12
-rw-r--r--src/backend/utils/adt/rangetypes_gist.c29
-rw-r--r--src/backend/utils/adt/tsgistidx.c4
-rw-r--r--src/backend/utils/adt/tsquery_gist.c9
5 files changed, 17 insertions, 69 deletions
diff --git a/src/backend/access/gist/gistproc.c b/src/backend/access/gist/gistproc.c
index 08990f5a1be..d1919fc74bc 100644
--- a/src/backend/access/gist/gistproc.c
+++ b/src/backend/access/gist/gistproc.c
@@ -185,37 +185,9 @@ gist_box_union(PG_FUNCTION_ARGS)
}
/*
- * GiST Compress methods for boxes
- *
- * do not do anything.
+ * We store boxes as boxes in GiST indexes, so we do not need
+ * compress, decompress, or fetch functions.
*/
-Datum
-gist_box_compress(PG_FUNCTION_ARGS)
-{
- PG_RETURN_POINTER(PG_GETARG_POINTER(0));
-}
-
-/*
- * GiST DeCompress method for boxes (also used for points, polygons
- * and circles)
- *
- * do not do anything --- we just use the stored box as is.
- */
-Datum
-gist_box_decompress(PG_FUNCTION_ARGS)
-{
- PG_RETURN_POINTER(PG_GETARG_POINTER(0));
-}
-
-/*
- * GiST Fetch method for boxes
- * do not do anything --- we just return the stored box as is.
- */
-Datum
-gist_box_fetch(PG_FUNCTION_ARGS)
-{
- PG_RETURN_POINTER(PG_GETARG_POINTER(0));
-}
/*
* The GiST Penalty method for boxes (also used for points)
diff --git a/src/backend/utils/adt/network_gist.c b/src/backend/utils/adt/network_gist.c
index a0097dae9c5..0e36b7685de 100644
--- a/src/backend/utils/adt/network_gist.c
+++ b/src/backend/utils/adt/network_gist.c
@@ -576,17 +576,9 @@ inet_gist_compress(PG_FUNCTION_ARGS)
}
/*
- * The GiST decompress function
- *
- * do not do anything --- we just use the stored GistInetKey as-is.
+ * We do not need a decompress function, because the other GiST inet
+ * support functions work with the GistInetKey representation.
*/
-Datum
-inet_gist_decompress(PG_FUNCTION_ARGS)
-{
- GISTENTRY *entry = (GISTENTRY *) PG_GETARG_POINTER(0);
-
- PG_RETURN_POINTER(entry);
-}
/*
* The GiST fetch function
diff --git a/src/backend/utils/adt/rangetypes_gist.c b/src/backend/utils/adt/rangetypes_gist.c
index cb2d5a3b73a..29fa1ae325b 100644
--- a/src/backend/utils/adt/rangetypes_gist.c
+++ b/src/backend/utils/adt/rangetypes_gist.c
@@ -216,30 +216,11 @@ range_gist_union(PG_FUNCTION_ARGS)
PG_RETURN_RANGE_P(result_range);
}
-/* compress, decompress, fetch are no-ops */
-Datum
-range_gist_compress(PG_FUNCTION_ARGS)
-{
- GISTENTRY *entry = (GISTENTRY *) PG_GETARG_POINTER(0);
-
- PG_RETURN_POINTER(entry);
-}
-
-Datum
-range_gist_decompress(PG_FUNCTION_ARGS)
-{
- GISTENTRY *entry = (GISTENTRY *) PG_GETARG_POINTER(0);
-
- PG_RETURN_POINTER(entry);
-}
-
-Datum
-range_gist_fetch(PG_FUNCTION_ARGS)
-{
- GISTENTRY *entry = (GISTENTRY *) PG_GETARG_POINTER(0);
-
- PG_RETURN_POINTER(entry);
-}
+/*
+ * We store ranges as ranges in GiST indexes, so we do not need
+ * compress, decompress, or fetch functions. Note this implies a limit
+ * on the size of range values that can be indexed.
+ */
/*
* GiST page split penalty function.
diff --git a/src/backend/utils/adt/tsgistidx.c b/src/backend/utils/adt/tsgistidx.c
index 732d87f22ff..578af5d5126 100644
--- a/src/backend/utils/adt/tsgistidx.c
+++ b/src/backend/utils/adt/tsgistidx.c
@@ -272,6 +272,10 @@ gtsvector_compress(PG_FUNCTION_ARGS)
Datum
gtsvector_decompress(PG_FUNCTION_ARGS)
{
+ /*
+ * We need to detoast the stored value, because the other gtsvector
+ * support functions don't cope with toasted values.
+ */
GISTENTRY *entry = (GISTENTRY *) PG_GETARG_POINTER(0);
SignTSVector *key = (SignTSVector *) PG_DETOAST_DATUM(entry->key);
diff --git a/src/backend/utils/adt/tsquery_gist.c b/src/backend/utils/adt/tsquery_gist.c
index 85518dc7d9f..05bc0d6adb3 100644
--- a/src/backend/utils/adt/tsquery_gist.c
+++ b/src/backend/utils/adt/tsquery_gist.c
@@ -43,11 +43,10 @@ gtsquery_compress(PG_FUNCTION_ARGS)
PG_RETURN_POINTER(retval);
}
-Datum
-gtsquery_decompress(PG_FUNCTION_ARGS)
-{
- PG_RETURN_DATUM(PG_GETARG_DATUM(0));
-}
+/*
+ * We do not need a decompress function, because the other gtsquery
+ * support functions work with the compressed representation.
+ */
Datum
gtsquery_consistent(PG_FUNCTION_ARGS)