summaryrefslogtreecommitdiff
path: root/src/include/nodes
diff options
context:
space:
mode:
authorTom Lane2001-05-07 00:43:27 +0000
committerTom Lane2001-05-07 00:43:27 +0000
commitf905d65ee35b3f84b6d4433a5198af0e2e7bd090 (patch)
tree68f5955bb1a7ecaa531cf6b3752f563943dbe079 /src/include/nodes
parent9583aea9d09f6b3839ede8e57f990262b24e6979 (diff)
Rewrite of planner statistics-gathering code. ANALYZE is now available as
a separate statement (though it can still be invoked as part of VACUUM, too). pg_statistic redesigned to be more flexible about what statistics are stored. ANALYZE now collects a list of several of the most common values, not just one, plus a histogram (not just the min and max values). Random sampling is used to make the process reasonably fast even on very large tables. The number of values and histogram bins collected is now user-settable via an ALTER TABLE command. There is more still to do; the new stats are not being used everywhere they could be in the planner. But the remaining changes for this project should be localized, and the behavior is already better than before. A not-very-related change is that sorting now makes use of btree comparison routines if it can find one, rather than invoking '<' twice.
Diffstat (limited to 'src/include/nodes')
-rw-r--r--src/include/nodes/execnodes.h4
-rw-r--r--src/include/nodes/parsenodes.h21
-rw-r--r--src/include/nodes/primnodes.h8
-rw-r--r--src/include/nodes/relation.h6
4 files changed, 21 insertions, 18 deletions
diff --git a/src/include/nodes/execnodes.h b/src/include/nodes/execnodes.h
index 2cf9378cf11..0967bef24ba 100644
--- a/src/include/nodes/execnodes.h
+++ b/src/include/nodes/execnodes.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: execnodes.h,v 1.57 2001/03/22 04:00:50 momjian Exp $
+ * $Id: execnodes.h,v 1.58 2001/05/07 00:43:25 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -628,7 +628,6 @@ typedef struct GroupState
* SortState information
*
* sort_Done indicates whether sort has been performed yet
- * sort_Keys scan key structures describing the sort keys
* tuplesortstate private state of tuplesort.c
* ----------------
*/
@@ -636,7 +635,6 @@ typedef struct SortState
{
CommonScanState csstate; /* its first field is NodeTag */
bool sort_Done;
- ScanKey sort_Keys;
void *tuplesortstate;
} SortState;
diff --git a/src/include/nodes/parsenodes.h b/src/include/nodes/parsenodes.h
index 1614d787bcb..63b1b1046a8 100644
--- a/src/include/nodes/parsenodes.h
+++ b/src/include/nodes/parsenodes.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: parsenodes.h,v 1.126 2001/03/23 04:49:56 momjian Exp $
+ * $Id: parsenodes.h,v 1.127 2001/05/07 00:43:25 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -118,11 +118,12 @@ typedef struct AlterTableStmt
NodeTag type;
char subtype; /*------------
* A = add column
- * T = alter column
+ * T = alter column default
+ * S = alter column statistics
* D = drop column
* C = add constraint
* X = drop constraint
- * E = add toast table,
+ * E = create toast table
* U = change owner
*------------
*/
@@ -690,16 +691,20 @@ typedef struct ClusterStmt
} ClusterStmt;
/* ----------------------
- * Vacuum Statement
+ * Vacuum and Analyze Statements
+ *
+ * Even though these are nominally two statements, it's convenient to use
+ * just one node type for both.
* ----------------------
*/
typedef struct VacuumStmt
{
NodeTag type;
- bool verbose; /* print status info */
- bool analyze; /* analyze data */
- char *vacrel; /* table to vacuum */
- List *va_spec; /* columns to analyse */
+ bool vacuum; /* do VACUUM step */
+ bool analyze; /* do ANALYZE step */
+ bool verbose; /* print progress info */
+ char *vacrel; /* name of single table to process, or NULL */
+ List *va_cols; /* list of column names, or NIL for all */
} VacuumStmt;
/* ----------------------
diff --git a/src/include/nodes/primnodes.h b/src/include/nodes/primnodes.h
index 3ae8e09f57a..9e69ed60992 100644
--- a/src/include/nodes/primnodes.h
+++ b/src/include/nodes/primnodes.h
@@ -10,7 +10,7 @@
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: primnodes.h,v 1.53 2001/03/22 04:00:52 momjian Exp $
+ * $Id: primnodes.h,v 1.54 2001/05/07 00:43:25 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -45,8 +45,8 @@ typedef struct FunctionCache *FunctionCachePtr;
* reskey and reskeyop are the execution-time representation of sorting.
* reskey must be zero in any non-sort-key item. The reskey of sort key
* targetlist items for a sort plan node is 1,2,...,n for the n sort keys.
- * The reskeyop of each such targetlist item is the sort operator's
- * regproc OID. reskeyop will be zero in non-sort-key items.
+ * The reskeyop of each such targetlist item is the sort operator's OID.
+ * reskeyop will be zero in non-sort-key items.
*
* Both reskey and reskeyop are typically zero during parse/plan stages.
* The executor does not pay any attention to ressortgroupref.
@@ -62,7 +62,7 @@ typedef struct Resdom
Index ressortgroupref;
/* nonzero if referenced by a sort/group clause */
Index reskey; /* order of key in a sort (for those > 0) */
- Oid reskeyop; /* sort operator's regproc Oid */
+ Oid reskeyop; /* sort operator's Oid */
bool resjunk; /* set to true to eliminate the attribute
* from final target list */
} Resdom;
diff --git a/src/include/nodes/relation.h b/src/include/nodes/relation.h
index f643ef87968..c76d9b4af71 100644
--- a/src/include/nodes/relation.h
+++ b/src/include/nodes/relation.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: relation.h,v 1.54 2001/03/22 04:00:53 momjian Exp $
+ * $Id: relation.h,v 1.55 2001/05/07 00:43:26 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -512,8 +512,8 @@ typedef struct RestrictInfo
Oid hashjoinoperator; /* copy of clause operator */
/* cache space for hashclause processing; -1 if not yet set */
- Selectivity left_dispersion;/* dispersion of left side */
- Selectivity right_dispersion; /* dispersion of right side */
+ Selectivity left_bucketsize; /* avg bucketsize of left side */
+ Selectivity right_bucketsize; /* avg bucketsize of right side */
} RestrictInfo;
/*