From e09b48316c22fce727bce3c89fa64fc627787e6a Mon Sep 17 00:00:00 2001 From: Heikki Linnakangas Date: Fri, 27 Mar 2015 23:35:16 +0200 Subject: Add index-only scan support to btree_gist. inet, cidr, and timetz indexes still cannot support index-only scans, because they don't store the original unmodified value in the index, but a derived approximate value. --- contrib/btree_gist/btree_interval.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'contrib/btree_gist/btree_interval.c') diff --git a/contrib/btree_gist/btree_interval.c b/contrib/btree_gist/btree_interval.c index 68d80e8e0ae..acccb8b42e7 100644 --- a/contrib/btree_gist/btree_interval.c +++ b/contrib/btree_gist/btree_interval.c @@ -18,6 +18,7 @@ typedef struct ** Interval ops */ PG_FUNCTION_INFO_V1(gbt_intv_compress); +PG_FUNCTION_INFO_V1(gbt_intv_fetch); PG_FUNCTION_INFO_V1(gbt_intv_decompress); PG_FUNCTION_INFO_V1(gbt_intv_union); PG_FUNCTION_INFO_V1(gbt_intv_picksplit); @@ -174,6 +175,14 @@ gbt_intv_compress(PG_FUNCTION_ARGS) } +Datum +gbt_intv_fetch(PG_FUNCTION_ARGS) +{ + GISTENTRY *entry = (GISTENTRY *) PG_GETARG_POINTER(0); + + PG_RETURN_POINTER(gbt_num_fetch(entry, &tinfo)); +} + Datum gbt_intv_decompress(PG_FUNCTION_ARGS) { -- cgit v1.2.3