summaryrefslogtreecommitdiff
path: root/src/include/access/gist.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/access/gist.h')
-rw-r--r--src/include/access/gist.h25
1 files changed, 16 insertions, 9 deletions
diff --git a/src/include/access/gist.h b/src/include/access/gist.h
index c3c5493f76..df9f39c7b8 100644
--- a/src/include/access/gist.h
+++ b/src/include/access/gist.h
@@ -6,10 +6,10 @@
* changes should be made with care.
*
*
- * Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2011, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/access/gist.h,v 1.63 2010/01/02 16:58:00 momjian Exp $
+ * src/include/access/gist.h
*
*-------------------------------------------------------------------------
*/
@@ -32,7 +32,8 @@
#define GIST_PENALTY_PROC 5
#define GIST_PICKSPLIT_PROC 6
#define GIST_EQUAL_PROC 7
-#define GISTNProcs 7
+#define GIST_DISTANCE_PROC 8
+#define GISTNProcs 8
/*
* strategy numbers for GiST opclasses that want to implement the old
@@ -52,13 +53,15 @@
#define RTOverAboveStrategyNumber 12
#define RTOldContainsStrategyNumber 13 /* for old spelling of @> */
#define RTOldContainedByStrategyNumber 14 /* for old spelling of <@ */
+#define RTKNNSearchStrategyNumber 15
/*
* Page opaque data in a GiST index page.
*/
-#define F_LEAF (1 << 0)
-#define F_DELETED (1 << 1)
-#define F_TUPLES_DELETED (1 << 2)
+#define F_LEAF (1 << 0) /* leaf page */
+#define F_DELETED (1 << 1) /* the page has been deleted */
+#define F_TUPLES_DELETED (1 << 2) /* some tuples on the page are dead */
+#define F_FOLLOW_RIGHT (1 << 3) /* page to the right has no downlink */
typedef XLogRecPtr GistNSN;
@@ -130,14 +133,18 @@ typedef struct GISTENTRY
#define GistMarkTuplesDeleted(page) ( GistPageGetOpaque(page)->flags |= F_TUPLES_DELETED)
#define GistClearTuplesDeleted(page) ( GistPageGetOpaque(page)->flags &= ~F_TUPLES_DELETED)
+#define GistFollowRight(page) ( GistPageGetOpaque(page)->flags & F_FOLLOW_RIGHT)
+#define GistMarkFollowRight(page) ( GistPageGetOpaque(page)->flags |= F_FOLLOW_RIGHT)
+#define GistClearFollowRight(page) ( GistPageGetOpaque(page)->flags &= ~F_FOLLOW_RIGHT)
+
/*
- * Vector of GISTENTRY structs; user-defined methods union and pick
- * split takes it as one of their arguments
+ * Vector of GISTENTRY structs; user-defined methods union and picksplit
+ * take it as one of their arguments
*/
typedef struct
{
int32 n; /* number of elements */
- GISTENTRY vector[1];
+ GISTENTRY vector[1]; /* variable-length array */
} GistEntryVector;
#define GEVHDRSZ (offsetof(GistEntryVector, vector))