aboutsummaryrefslogtreecommitdiff
path: root/src/include/access/gist.h
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2007-04-09 22:04:08 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2007-04-09 22:04:08 +0000
commit56218fbc487991ed98358cd8016dc5c4615bed96 (patch)
tree0840591dffb49c556f0943e1c91b0628c18b4ced /src/include/access/gist.h
parent485d9ca96ff0ef6ab1e424a4ded3eeb53a9cf3df (diff)
downloadpostgresql-56218fbc487991ed98358cd8016dc5c4615bed96.tar.gz
postgresql-56218fbc487991ed98358cd8016dc5c4615bed96.zip
Minor tweaking of index special-space definitions so that the various
index types can be reliably distinguished by examining the special space on an index page. Per my earlier proposal, plus the realization that there's no need for btree's vacuum cycle ID to cycle through every possible 16-bit value. Restricting its range a little costs nearly nothing and eliminates the possibility of collisions. Memo to self: remember to make bitmap indexes play along with this scheme, assuming that patch ever gets accepted.
Diffstat (limited to 'src/include/access/gist.h')
-rw-r--r--src/include/access/gist.h25
1 files changed, 15 insertions, 10 deletions
diff --git a/src/include/access/gist.h b/src/include/access/gist.h
index 52d3a2fe1a0..eab6a01bfd5 100644
--- a/src/include/access/gist.h
+++ b/src/include/access/gist.h
@@ -9,7 +9,7 @@
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/access/gist.h,v 1.57 2007/01/05 22:19:50 momjian Exp $
+ * $PostgreSQL: pgsql/src/include/access/gist.h,v 1.58 2007/04/09 22:04:05 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -56,26 +56,31 @@
/*
* Page opaque data in a GiST index page.
*/
-#define F_LEAF (1 << 0)
-#define F_DELETED (1 << 1)
+#define F_LEAF (1 << 0)
+#define F_DELETED (1 << 1)
#define F_TUPLES_DELETED (1 << 2)
typedef XLogRecPtr GistNSN;
typedef struct GISTPageOpaqueData
{
- uint32 flags; /* 29 bits are unused for now */
- BlockNumber rightlink;
-
- /*
- * the only meaning - change this value if page split.
- */
- GistNSN nsn;
+ GistNSN nsn; /* this value must change on page split */
+ BlockNumber rightlink; /* next page if any */
+ uint16 flags; /* see bit definitions above */
+ uint16 gist_page_id; /* for identification of GiST indexes */
} GISTPageOpaqueData;
typedef GISTPageOpaqueData *GISTPageOpaque;
/*
+ * The page ID is for the convenience of pg_filedump and similar utilities,
+ * which otherwise would have a hard time telling pages of different index
+ * types apart. It should be the last 2 bytes on the page. This is more or
+ * less "free" due to alignment considerations.
+ */
+#define GIST_PAGE_ID 0xFF81
+
+/*
* This is the Split Vector to be returned by the PickSplit method.
* PickSplit should check spl_(r|l)datum_exists. If it is 'true',
* that corresponding spl_(r|l)datum already defined and