summaryrefslogtreecommitdiff
path: root/src/include/optimizer
diff options
context:
space:
mode:
authorTom Lane2008-03-15 20:46:31 +0000
committerTom Lane2008-03-15 20:46:31 +0000
commitc9a1cc694abef737548a2aa096c555fa4b253102 (patch)
tree70d118428f39db307a576fde01f9ade8e8aaf7bd /src/include/optimizer
parent4873c96ff3f38b51b29c86ede658343be01f519f (diff)
Change hash index creation so that rather than always establishing exactly
two buckets at the start, we create a number of buckets appropriate for the estimated size of the table. This avoids a lot of expensive bucket-split actions during initial index build on an already-populated table. This is one of the two core ideas of Tom Raney and Shreya Bhargava's patch to reduce hash index build time. I'm committing it separately to make it easier for people to test the effects of this separately from the effects of their other core idea (pre-sorting the index entries by bucket number).
Diffstat (limited to 'src/include/optimizer')
-rw-r--r--src/include/optimizer/plancat.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/include/optimizer/plancat.h b/src/include/optimizer/plancat.h
index 42e24832495..82b4c2200ad 100644
--- a/src/include/optimizer/plancat.h
+++ b/src/include/optimizer/plancat.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/optimizer/plancat.h,v 1.47 2008/01/01 19:45:58 momjian Exp $
+ * $PostgreSQL: pgsql/src/include/optimizer/plancat.h,v 1.48 2008/03/15 20:46:31 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -15,6 +15,7 @@
#define PLANCAT_H
#include "nodes/relation.h"
+#include "utils/rel.h"
/* Hook for plugins to get control in get_relation_info() */
typedef void (*get_relation_info_hook_type) (PlannerInfo *root,
@@ -27,6 +28,9 @@ extern PGDLLIMPORT get_relation_info_hook_type get_relation_info_hook;
extern void get_relation_info(PlannerInfo *root, Oid relationObjectId,
bool inhparent, RelOptInfo *rel);
+extern void estimate_rel_size(Relation rel, int32 *attr_widths,
+ BlockNumber *pages, double *tuples);
+
extern bool relation_excluded_by_constraints(RelOptInfo *rel,
RangeTblEntry *rte);