aboutsummaryrefslogtreecommitdiff
path: root/contrib/ltree/ltree_gist.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2008-04-14 17:05:34 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2008-04-14 17:05:34 +0000
commit9b5c8d45f62bd3d243a40cc84deb93893f2f5122 (patch)
tree2d75607f7bdb96cfa1d73a3a36a4b3328118ff08 /contrib/ltree/ltree_gist.c
parent10be77c173211a75718f50fe6061862f6a0cb4a2 (diff)
downloadpostgresql-9b5c8d45f62bd3d243a40cc84deb93893f2f5122.tar.gz
postgresql-9b5c8d45f62bd3d243a40cc84deb93893f2f5122.zip
Push index operator lossiness determination down to GIST/GIN opclass
"consistent" functions, and remove pg_amop.opreqcheck, as per recent discussion. The main immediate benefit of this is that we no longer need 8.3's ugly hack of requiring @@@ rather than @@ to test weight-using tsquery searches on GIN indexes. In future it should be possible to optimize some other queries better than is done now, by detecting at runtime whether the index match is exact or not. Tom Lane, after an idea of Heikki's, and with some help from Teodor.
Diffstat (limited to 'contrib/ltree/ltree_gist.c')
-rw-r--r--contrib/ltree/ltree_gist.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/contrib/ltree/ltree_gist.c b/contrib/ltree/ltree_gist.c
index dea0b9c3863..17c44b93aac 100644
--- a/contrib/ltree/ltree_gist.c
+++ b/contrib/ltree/ltree_gist.c
@@ -1,7 +1,7 @@
/*
* GiST support for ltree
* Teodor Sigaev <teodor@stack.net>
- * $PostgreSQL: pgsql/contrib/ltree/ltree_gist.c,v 1.22 2007/11/16 01:12:24 momjian Exp $
+ * $PostgreSQL: pgsql/contrib/ltree/ltree_gist.c,v 1.23 2008/04/14 17:05:32 tgl Exp $
*/
#include "ltree.h"
@@ -624,11 +624,16 @@ Datum
ltree_consistent(PG_FUNCTION_ARGS)
{
GISTENTRY *entry = (GISTENTRY *) PG_GETARG_POINTER(0);
- void *query = NULL;
- ltree_gist *key = (ltree_gist *) DatumGetPointer(entry->key);
StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
+ /* Oid subtype = PG_GETARG_OID(3); */
+ bool *recheck = (bool *) PG_GETARG_POINTER(4);
+ ltree_gist *key = (ltree_gist *) DatumGetPointer(entry->key);
+ void *query = NULL;
bool res = false;
+ /* All cases served by this function are exact */
+ *recheck = false;
+
switch (strategy)
{
case BTLessStrategyNumber: