diff --git a/src/backend/catalog/aclchk.c b/src/backend/catalog/aclchk.c
index 701cb4df149ee053e2c531613515929197933be0..ad767e742405e6d37f477ef17b80770af4b16c4c 100644
--- a/src/backend/catalog/aclchk.c
+++ b/src/backend/catalog/aclchk.c
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *	  $Header: /cvsroot/pgsql/src/backend/catalog/aclchk.c,v 1.31 1999/11/24 00:44:28 momjian Exp $
+ *	  $Header: /cvsroot/pgsql/src/backend/catalog/aclchk.c,v 1.32 1999/11/24 16:52:31 momjian Exp $
  *
  * NOTES
  *	  See acl.h.
@@ -350,7 +350,7 @@ pg_aclcheck(char *relname, char *usename, AclMode mode)
 	int32		result;
 	Relation	relation;
 
-	tuple = SearchSysCacheTuple(USERNAME,
+	tuple = SearchSysCacheTuple(SHADOWNAME,
 								PointerGetDatum(usename),
 								0, 0, 0);
 	if (!HeapTupleIsValid(tuple))
@@ -469,7 +469,7 @@ pg_ownercheck(char *usename,
 	AclId		user_id,
 				owner_id = 0;
 
-	tuple = SearchSysCacheTuple(USERNAME,
+	tuple = SearchSysCacheTuple(SHADOWNAME,
 								PointerGetDatum(usename),
 								0, 0, 0);
 	if (!HeapTupleIsValid(tuple))
@@ -535,7 +535,7 @@ pg_func_ownercheck(char *usename,
 	AclId		user_id,
 				owner_id;
 
-	tuple = SearchSysCacheTuple(USERNAME,
+	tuple = SearchSysCacheTuple(SHADOWNAME,
 								PointerGetDatum(usename),
 								0, 0, 0);
 	if (!HeapTupleIsValid(tuple))
@@ -577,7 +577,7 @@ pg_aggr_ownercheck(char *usename,
 	AclId		user_id,
 				owner_id;
 
-	tuple = SearchSysCacheTuple(USERNAME,
+	tuple = SearchSysCacheTuple(SHADOWNAME,
 								PointerGetDatum(usename),
 								0, 0, 0);
 	if (!HeapTupleIsValid(tuple))
diff --git a/src/backend/catalog/indexing.c b/src/backend/catalog/indexing.c
index 1dfd531d3453bcade634e7abb2ed98502226b9a0..0815fce3c4bf5bfd2f524208100c5b4ebd22e789 100644
--- a/src/backend/catalog/indexing.c
+++ b/src/backend/catalog/indexing.c
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *	  $Header: /cvsroot/pgsql/src/backend/catalog/indexing.c,v 1.51 1999/11/22 17:55:57 momjian Exp $
+ *	  $Header: /cvsroot/pgsql/src/backend/catalog/indexing.c,v 1.52 1999/11/24 16:52:31 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -881,42 +881,77 @@ RewriteOidIndexScan(Relation heapRelation, Oid rewriteId)
 
 
 HeapTuple
-TypeNameIndexScan(Relation heapRelation, char *typeName)
+ShadowNameIndexScan(Relation heapRelation, char *useName)
 {
 	Relation	idesc;
 	ScanKeyData skey[1];
 	HeapTuple	tuple;
-
+	
 	ScanKeyEntryInitialize(&skey[0],
 						   (bits16) 0x0,
 						   (AttrNumber) 1,
 						   (RegProcedure) F_NAMEEQ,
-						   PointerGetDatum(typeName));
+						   PointerGetDatum(useName));
 
-	idesc = index_openr(TypeNameIndex);
+	idesc = index_openr(ShadowNameIndex);
 	tuple = CatalogIndexFetchTuple(heapRelation, idesc, skey, 1);
 
 	index_close(idesc);
-
 	return tuple;
 }
 
 
 HeapTuple
-TypeOidIndexScan(Relation heapRelation, Oid typeId)
+ShadowSysidIndexScan(Relation heapRelation, int4 sysId)
 {
 	Relation	idesc;
 	ScanKeyData skey[1];
 	HeapTuple	tuple;
+	
+	ScanKeyEntryInitialize(&skey[0],
+						   (bits16) 0x0,
+						   (AttrNumber) 1,
+						   (RegProcedure) F_INT4EQ,
+						   Int32GetDatum(sysId));
+
+	idesc = index_openr(ShadowSysidIndex);
+	tuple = CatalogIndexFetchTuple(heapRelation, idesc, skey, 1);
+
+	index_close(idesc);
+	return tuple;
+}
+
+
+HeapTuple
+StatisticRelidAttnumOpIndexScan(Relation heapRelation,
+					   Oid relId,
+					   AttrNumber attNum,
+					   Oid op)
+{
+	Relation	idesc;
+	ScanKeyData skey[3];
+	HeapTuple	tuple;
 
 	ScanKeyEntryInitialize(&skey[0],
 						   (bits16) 0x0,
 						   (AttrNumber) 1,
 						   (RegProcedure) F_OIDEQ,
-						   ObjectIdGetDatum(typeId));
+						   ObjectIdGetDatum(relId));
 
-	idesc = index_openr(TypeOidIndex);
-	tuple = CatalogIndexFetchTuple(heapRelation, idesc, skey, 1);
+	ScanKeyEntryInitialize(&skey[1],
+						   (bits16) 0x0,
+						   (AttrNumber) 2,
+						   (RegProcedure) F_INT2EQ,
+						   Int16GetDatum(attNum));
+
+	ScanKeyEntryInitialize(&skey[2],
+						   (bits16) 0x0,
+						   (AttrNumber) 3,
+						   (RegProcedure) F_OIDEQ,
+						   ObjectIdGetDatum(op));
+
+	idesc = index_openr(StatisticRelidAttnumOpIndex);
+	tuple = CatalogIndexFetchTuple(heapRelation, idesc, skey, 3);
 
 	index_close(idesc);
 
@@ -925,44 +960,45 @@ TypeOidIndexScan(Relation heapRelation, Oid typeId)
 
 
 HeapTuple
-ShadowNameIndexScan(Relation heapRelation, char *useName)
+TypeNameIndexScan(Relation heapRelation, char *typeName)
 {
 	Relation	idesc;
 	ScanKeyData skey[1];
 	HeapTuple	tuple;
-	
+
 	ScanKeyEntryInitialize(&skey[0],
 						   (bits16) 0x0,
 						   (AttrNumber) 1,
 						   (RegProcedure) F_NAMEEQ,
-						   PointerGetDatum(useName));
+						   PointerGetDatum(typeName));
 
-	idesc = index_openr(ShadowNameIndex);
+	idesc = index_openr(TypeNameIndex);
 	tuple = CatalogIndexFetchTuple(heapRelation, idesc, skey, 1);
 
 	index_close(idesc);
+
 	return tuple;
 }
 
 
 HeapTuple
-ShadowSysidIndexScan(Relation heapRelation, int4 sysId)
+TypeOidIndexScan(Relation heapRelation, Oid typeId)
 {
 	Relation	idesc;
 	ScanKeyData skey[1];
 	HeapTuple	tuple;
-	
+
 	ScanKeyEntryInitialize(&skey[0],
 						   (bits16) 0x0,
 						   (AttrNumber) 1,
-						   (RegProcedure) F_INT4EQ,
-						   Int32GetDatum(sysId));
+						   (RegProcedure) F_OIDEQ,
+						   ObjectIdGetDatum(typeId));
 
-	idesc = index_openr(ShadowSysidIndex);
+	idesc = index_openr(TypeOidIndex);
 	tuple = CatalogIndexFetchTuple(heapRelation, idesc, skey, 1);
 
 	index_close(idesc);
+
 	return tuple;
 }
 
-
diff --git a/src/backend/commands/comment.c b/src/backend/commands/comment.c
index 4d58eb3ccc1984a019db30ce6156766ac25c882a..1b046a5f57a3cb35efb8e93df3d55ea98ec9d181 100644
--- a/src/backend/commands/comment.c
+++ b/src/backend/commands/comment.c
@@ -395,7 +395,7 @@ void CommentDatabase(char *database, char *comment) {
   /*** Now, fetch user information ***/
   
   username = GetPgUserName();
-  usertuple = SearchSysCacheTuple(USERNAME, PointerGetDatum(username),
+  usertuple = SearchSysCacheTuple(SHADOWNAME, PointerGetDatum(username),
 				  0, 0, 0);
   if (!HeapTupleIsValid(usertuple)) {
     elog(ERROR, "current user '%s' does not exist", username);
diff --git a/src/backend/commands/dbcommands.c b/src/backend/commands/dbcommands.c
index 0fd64a10caf13ae7ea0b991bb9ce09658fd4f34e..26f7bcf71b845f02cb84caf1e6e9bac6b50ff77b 100644
--- a/src/backend/commands/dbcommands.c
+++ b/src/backend/commands/dbcommands.c
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *	  $Header: /cvsroot/pgsql/src/backend/commands/dbcommands.c,v 1.44 1999/11/22 17:56:01 momjian Exp $
+ *	  $Header: /cvsroot/pgsql/src/backend/commands/dbcommands.c,v 1.45 1999/11/24 16:52:32 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -241,7 +241,7 @@ check_permissions(char *command,
 	char		path[MAXPGPATH];
 
 	userName = GetPgUserName();
-	utup = SearchSysCacheTuple(USERNAME,
+	utup = SearchSysCacheTuple(SHADOWNAME,
 							   PointerGetDatum(userName),
 							   0, 0, 0);
 	Assert(utup);
diff --git a/src/backend/commands/user.c b/src/backend/commands/user.c
index b7bfff8710290b2b0196958a553861678f74146d..27a11cbcaf1df285f3eee2b71366f879cc7779b6 100644
--- a/src/backend/commands/user.c
+++ b/src/backend/commands/user.c
@@ -5,7 +5,7 @@
  *
  * Copyright (c) 1994, Regents of the University of California
  *
- * $Id: user.c,v 1.37 1999/11/22 17:56:02 momjian Exp $
+ * $Id: user.c,v 1.38 1999/11/24 16:52:32 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -261,7 +261,7 @@ AlterUser(AlterUserStmt *stmt, CommandDest dest)
 	pg_shadow_rel = heap_openr(ShadowRelationName, AccessExclusiveLock);
 	pg_shadow_dsc = RelationGetDescr(pg_shadow_rel);
 
-	tuple = SearchSysCacheTuple(USERNAME,
+	tuple = SearchSysCacheTuple(SHADOWNAME,
 								PointerGetDatum(stmt->user),
 								0, 0, 0);
 	if (!HeapTupleIsValid(tuple))
@@ -374,7 +374,7 @@ RemoveUser(char *user, CommandDest dest)
 	pg_shadow_rel = heap_openr(ShadowRelationName, AccessExclusiveLock);
 	pg_dsc = RelationGetDescr(pg_shadow_rel);
 
-	tuple = SearchSysCacheTuple(USERNAME,
+	tuple = SearchSysCacheTuple(SHADOWNAME,
 								PointerGetDatum(user),
 								0, 0, 0);
 	if (!HeapTupleIsValid(tuple))
diff --git a/src/backend/rewrite/locks.c b/src/backend/rewrite/locks.c
index aea4ee582089378b747e1ec9b4e092b4a075a1e9..4f6434d9245a107aeb42268cd271f5ba15e713f0 100644
--- a/src/backend/rewrite/locks.c
+++ b/src/backend/rewrite/locks.c
@@ -6,7 +6,7 @@
  *
  *
  * IDENTIFICATION
- *	  $Header: /cvsroot/pgsql/src/backend/rewrite/Attic/locks.c,v 1.25 1999/11/22 17:56:23 momjian Exp $
+ *	  $Header: /cvsroot/pgsql/src/backend/rewrite/Attic/locks.c,v 1.26 1999/11/24 16:52:33 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -170,7 +170,7 @@ checkLockPerms(List *locks, Query *parsetree, int rt_index)
 	 */
 	rte = (RangeTblEntry *) nth(rt_index - 1, parsetree->rtable);
 	ev_rel = heap_openr(rte->relname, AccessShareLock);
-	usertup = SearchSysCacheTuple(USERSYSID,
+	usertup = SearchSysCacheTuple(SHADOWSYSID,
 							  ObjectIdGetDatum(ev_rel->rd_rel->relowner),
 								  0, 0, 0);
 	if (!HeapTupleIsValid(usertup))
diff --git a/src/backend/utils/adt/acl.c b/src/backend/utils/adt/acl.c
index 15db9b30416f0d2f3479493a7c3dcbb487de879a..ee3c41ace6cc08d4d3e698043461c6514dc4b231 100644
--- a/src/backend/utils/adt/acl.c
+++ b/src/backend/utils/adt/acl.c
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *	  $Header: /cvsroot/pgsql/src/backend/utils/adt/acl.c,v 1.42 1999/11/22 17:56:28 momjian Exp $
+ *	  $Header: /cvsroot/pgsql/src/backend/utils/adt/acl.c,v 1.43 1999/11/24 16:52:37 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -170,7 +170,7 @@ aclparse(char *s, AclItem *aip, unsigned *modechg)
 	switch (aip->ai_idtype)
 	{
 		case ACL_IDTYPE_UID:
-			htup = SearchSysCacheTuple(USERNAME,
+			htup = SearchSysCacheTuple(SHADOWNAME,
 									   PointerGetDatum(name),
 									   0, 0, 0);
 			if (!HeapTupleIsValid(htup))
@@ -281,7 +281,7 @@ aclitemout(AclItem *aip)
 	switch (aip->ai_idtype)
 	{
 		case ACL_IDTYPE_UID:
-			htup = SearchSysCacheTuple(USERSYSID,
+			htup = SearchSysCacheTuple(SHADOWSYSID,
 									   ObjectIdGetDatum(aip->ai_id),
 									   0, 0, 0);
 			if (!HeapTupleIsValid(htup))
diff --git a/src/backend/utils/adt/ruleutils.c b/src/backend/utils/adt/ruleutils.c
index a342daba8ba4edd97db91d9adf2d05cd39d45e90..a4f182770b92ccca8c9a0f4cbc69290f46594e73 100644
--- a/src/backend/utils/adt/ruleutils.c
+++ b/src/backend/utils/adt/ruleutils.c
@@ -3,7 +3,7 @@
  *			  out of it's tuple
  *
  * IDENTIFICATION
- *	  $Header: /cvsroot/pgsql/src/backend/utils/adt/ruleutils.c,v 1.32 1999/11/22 17:56:30 momjian Exp $
+ *	  $Header: /cvsroot/pgsql/src/backend/utils/adt/ruleutils.c,v 1.33 1999/11/24 16:52:37 momjian Exp $
  *
  *	  This software is copyrighted by Jan Wieck - Hamburg.
  *
@@ -567,7 +567,7 @@ pg_get_userbyid(int32 uid)
 	 * Get the pg_shadow entry and print the result
 	 * ----------
 	 */
-	usertup = SearchSysCacheTuple(USERSYSID,
+	usertup = SearchSysCacheTuple(SHADOWSYSID,
 								  ObjectIdGetDatum(uid), 0, 0, 0);
 	if (HeapTupleIsValid(usertup))
 	{
diff --git a/src/backend/utils/cache/syscache.c b/src/backend/utils/cache/syscache.c
index e14f27da8c9de808acac15d9f8f312a9ac682d17..d3e0648695def75e05e99dfb41261b84aa4ff9ff 100644
--- a/src/backend/utils/cache/syscache.c
+++ b/src/backend/utils/cache/syscache.c
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *	  $Header: /cvsroot/pgsql/src/backend/utils/cache/syscache.c,v 1.42 1999/11/24 00:58:48 momjian Exp $
+ *	  $Header: /cvsroot/pgsql/src/backend/utils/cache/syscache.c,v 1.43 1999/11/24 16:52:38 momjian Exp $
  *
  * NOTES
  *	  These routines allow the parser/planner/executor to perform
@@ -66,7 +66,8 @@ typedef HeapTuple (*ScanFunc) ();
     lookups return only one row, so the index should be unique.
 
     In backend/catalog/indexing.c, initialize the relation array with
-    the index names for the relation, and create the index lookup function.
+    the index names for the relation, fixed size of relation (or marking
+    first non-fixed length field), and create the index lookup function.
     Pick one that takes similar arguments and use that one, but keep the
     function names in the same order as the cache list for clarity.
 
@@ -333,52 +334,63 @@ static struct cachedesc cacheinfo[] = {
 		offsetof(FormData_pg_rewrite, ev_qual),
 		RewriteOidIndex,
 	RewriteOidIndexScan},
-	{TypeRelationName,			/* TYPENAME */
+	{ShadowRelationName,		/* SHADOWNAME */
 		1,
 		{
-			Anum_pg_type_typname,
+			Anum_pg_shadow_usename,
 			0,
 			0,
 			0
 		},
-		offsetof(FormData_pg_type, typalign) +sizeof(char),
-		TypeNameIndex,
-	TypeNameIndexScan},
-	{TypeRelationName,			/* TYPEOID */
+		sizeof(FormData_pg_shadow),
+NULL,NULL
+/*		ShadowNameIndex,
+	ShadowNameIndexScan*/},
+	{ShadowRelationName,		/* SHADOWSYSID */
 		1,
 		{
-			ObjectIdAttributeNumber,
+			Anum_pg_shadow_usesysid,
 			0,
 			0,
 			0
 		},
-		offsetof(FormData_pg_type, typalign) +sizeof(char),
-		TypeOidIndex,
-	TypeOidIndexScan},
-	{ShadowRelationName,		/* USERNAME */
+		sizeof(FormData_pg_shadow),
+NULL,NULL
+/*		ShadowSysidIndex,
+	ShadowSysidIndexScan*/},
+	{StatisticRelationName,		/* STATRELID */
+		3,
+		{
+			Anum_pg_statistic_starelid,
+			Anum_pg_statistic_staattnum,
+			Anum_pg_statistic_staop,
+			0
+		},
+		offsetof(FormData_pg_statistic, stacommonval),
+		StatisticRelidAttnumOpIndex,
+	StatisticRelidAttnumOpIndexScan},
+	{TypeRelationName,			/* TYPENAME */
 		1,
 		{
-			Anum_pg_shadow_usename,
+			Anum_pg_type_typname,
 			0,
 			0,
 			0
 		},
-		sizeof(FormData_pg_shadow),
-NULL,NULL
-/*		ShadowNameIndex,
-	ShadowNameIndexScan*/},
-	{ShadowRelationName,		/* USERSYSID */
+		offsetof(FormData_pg_type, typalign) +sizeof(char),
+		TypeNameIndex,
+	TypeNameIndexScan},
+	{TypeRelationName,			/* TYPEOID */
 		1,
 		{
-			Anum_pg_shadow_usesysid,
+			ObjectIdAttributeNumber,
 			0,
 			0,
 			0
 		},
-		sizeof(FormData_pg_shadow),
-NULL,NULL
-/*		ShadowSysidIndex,
-	ShadowSysidIndexScan*/}
+		offsetof(FormData_pg_type, typalign) +sizeof(char),
+		TypeOidIndex,
+	TypeOidIndexScan}
 };
 
 static struct catcache *SysCache[lengthof(cacheinfo)];
diff --git a/src/backend/utils/init/miscinit.c b/src/backend/utils/init/miscinit.c
index 0f6c376e8a099051d9bf6bbf45aacd82335f1608..18eed64195f73236c0f893ecac9bb21782dd8c98 100644
--- a/src/backend/utils/init/miscinit.c
+++ b/src/backend/utils/init/miscinit.c
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *	  $Header: /cvsroot/pgsql/src/backend/utils/init/miscinit.c,v 1.36 1999/11/22 17:56:34 momjian Exp $
+ *	  $Header: /cvsroot/pgsql/src/backend/utils/init/miscinit.c,v 1.37 1999/11/24 16:52:42 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -453,7 +453,7 @@ SetUserId()
 	}
 
 	userName = GetPgUserName();
-	userTup = SearchSysCacheTuple(USERNAME,
+	userTup = SearchSysCacheTuple(SHADOWNAME,
 								  PointerGetDatum(userName),
 								  0, 0, 0);
 	if (!HeapTupleIsValid(userTup))
diff --git a/src/backend/utils/misc/superuser.c b/src/backend/utils/misc/superuser.c
index cffaacdd7fa981c1302e1184a90976ff1579c19f..c1f0a3231db442b13d7572c9c3fc19a49d92a056 100644
--- a/src/backend/utils/misc/superuser.c
+++ b/src/backend/utils/misc/superuser.c
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *	  $Header: /cvsroot/pgsql/src/backend/utils/misc/superuser.c,v 1.11 1999/11/22 17:56:35 momjian Exp $
+ *	  $Header: /cvsroot/pgsql/src/backend/utils/misc/superuser.c,v 1.12 1999/11/24 16:52:45 momjian Exp $
  *
  * DESCRIPTION
  *	  See superuser().
@@ -30,7 +30,7 @@ superuser(void)
 
 	HeapTuple	utup;
 
-	utup = SearchSysCacheTuple(USERNAME,
+	utup = SearchSysCacheTuple(SHADOWNAME,
 							   PointerGetDatum(UserName),
 							   0, 0, 0);
 	Assert(utup != NULL);
diff --git a/src/include/catalog/catversion.h b/src/include/catalog/catversion.h
index 6ffe6f79a41092ca5bbedf02eba20a25900a5054..728c62b1200e11b7477e5e5ecf7a7461d599cab0 100644
--- a/src/include/catalog/catversion.h
+++ b/src/include/catalog/catversion.h
@@ -36,7 +36,7 @@
  *
  * Copyright (c) 1994, Regents of the University of California
  *
- * $Id: catversion.h,v 1.3 1999/11/22 17:56:37 momjian Exp $
+ * $Id: catversion.h,v 1.4 1999/11/24 16:52:48 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -51,6 +51,6 @@
  * catalog changes on the same day...)
  */
 
-#define CATALOG_VERSION_NO	199911221
+#define CATALOG_VERSION_NO	199911241
 
 #endif
diff --git a/src/include/catalog/indexing.h b/src/include/catalog/indexing.h
index 3531c4b9e8193ae934cd61d07bb822f892d5c25c..6faab87a1a94c5ae5b39fa0c7ca4b34323e399fb 100644
--- a/src/include/catalog/indexing.h
+++ b/src/include/catalog/indexing.h
@@ -7,7 +7,7 @@
  *
  * Copyright (c) 1994, Regents of the University of California
  *
- * $Id: indexing.h,v 1.30 1999/11/23 04:47:39 momjian Exp $
+ * $Id: indexing.h,v 1.31 1999/11/24 16:52:48 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -37,6 +37,7 @@
 #define Num_pg_relcheck_indices 	1
 #define Num_pg_rewrite_indices		2
 #define Num_pg_shadow_indices		2
+#define Num_pg_statistic_indices	1
 #define Num_pg_trigger_indices		3
 #define Num_pg_type_indices			2
 
@@ -72,6 +73,7 @@
 #define RewriteRulenameIndex		"pg_rewrite_rulename_index"
 #define ShadowNameIndex				"pg_shadow_name_index"
 #define ShadowSysidIndex			"pg_shadow_sysid_index"
+#define StatisticRelidAttnumOpIndex	"pg_statistic_relid_att_op_index"
 #define TriggerConstrNameIndex		"pg_trigger_tgconstrname_index"
 #define TriggerConstrRelidIndex		"pg_trigger_tgconstrrelid_index"
 #define TriggerRelidIndex			"pg_trigger_tgrelid_index"
@@ -96,6 +98,7 @@ extern char *Name_pg_proc_indices[];
 extern char *Name_pg_relcheck_indices[];
 extern char *Name_pg_rewrite_indices[];
 extern char *Name_pg_shadow_indices[];
+extern char *Name_pg_statistic_indices[];
 extern char *Name_pg_trigger_indices[];
 extern char *Name_pg_type_indices[];
 
@@ -150,6 +153,8 @@ extern HeapTuple RewriteRulenameIndexScan(Relation heapRelation,
 					char *ruleName);
 extern HeapTuple ShadowNameIndexScan(Relation heapRelation, char *useName);
 extern HeapTuple ShadowSysidIndexScan(Relation heapRelation, int4 sysId);
+extern HeapTuple StatisticRelidAttnumOpIndexScan(Relation heapRelation,
+				 Oid relId, AttrNumber attNum, Oid op);
 extern HeapTuple TypeNameIndexScan(Relation heapRelation, char *typeName);
 extern HeapTuple TypeOidIndexScan(Relation heapRelation, Oid typeId);
 
@@ -197,6 +202,7 @@ DECLARE_UNIQUE_INDEX(pg_rewrite_rulename_index on pg_rewrite using btree(rulenam
 xDECLARE_UNIQUE_INDEX(pg_shadow_name_index on pg_shadow using btree(usename name_ops));
 xDECLARE_UNIQUE_INDEX(pg_shadow_sysid_index on pg_shadow using btree(usesysid int4_ops));
 */
+DECLARE_INDEX(pg_statistic_relid_att_op_index on pg_shadow using btree(starelid oid_ops, staattnum int2_ops, staop oid_ops));
 DECLARE_INDEX(pg_trigger_tgconstrname_index on pg_trigger using btree(tgconstrname name_ops));
 DECLARE_INDEX(pg_trigger_tgconstrrelid_index on pg_trigger using btree(tgconstrrelid oid_ops));
 DECLARE_INDEX(pg_trigger_tgrelid_index on pg_trigger using btree(tgrelid oid_ops));
diff --git a/src/include/executor/nodeTidscan.h b/src/include/executor/nodeTidscan.h
new file mode 100644
index 0000000000000000000000000000000000000000..a54c553e0d66311fd8a595ca66b68bf767abec8b
--- /dev/null
+++ b/src/include/executor/nodeTidscan.h
@@ -0,0 +1,27 @@
+/*-------------------------------------------------------------------------
+ *
+ * nodeTidscan.h
+ *
+ *
+ *
+ * Copyright (c) 1994, Regents of the University of California
+ *
+ * $Id: nodeTidscan.h,v 1.1 1999/11/24 16:52:49 momjian Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef NODETIDSCAN_H
+#define NODETIDSCAN_H
+
+#include "nodes/plannodes.h"
+
+extern TupleTableSlot *ExecTidScan(TidScan *node);
+extern void ExecTidReScan(TidScan *node, ExprContext *exprCtxt, Plan *parent);
+extern void ExecEndTidScan(TidScan *node);
+extern void ExecTidMarkPos(TidScan *node);
+extern void ExecTidRestrPos(TidScan *node);
+extern bool ExecInitTidScan(TidScan *node, EState *estate, Plan *parent);
+extern int  ExecCountSlotsTidScan(TidScan *node);
+extern void ExecTidReScan(TidScan *node, ExprContext *exprCtxt, Plan *parent);
+
+#endif	 /* NODETIDSCAN_H */
diff --git a/src/include/utils/syscache.h b/src/include/utils/syscache.h
index 62b3d4ada7a60ad6f0f4f16ee7d6c0999dcae338..158a7bdb367ae60d86281c61943629bb3365cb97 100644
--- a/src/include/utils/syscache.h
+++ b/src/include/utils/syscache.h
@@ -8,7 +8,7 @@
  *
  * Copyright (c) 1994, Regents of the University of California
  *
- * $Id: syscache.h,v 1.21 1999/11/22 17:56:38 momjian Exp $
+ * $Id: syscache.h,v 1.22 1999/11/24 16:52:50 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -53,10 +53,11 @@
 #define RELOID			20
 #define RULENAME		21
 #define RULEOID			22
-#define TYPENAME		23
-#define TYPEOID			24
-#define USERNAME		25
-#define USERSYSID		26
+#define SHADOWNAME		23
+#define SHADOWSYSID		24
+#define STATRELID		25
+#define TYPENAME		26
+#define TYPEOID			27
 
 /* ----------------
  *		struct cachedesc:		information needed for a call to InitSysCache()