aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/backend/catalog/index.c8
-rw-r--r--src/backend/optimizer/path/costsize.c4
-rw-r--r--src/include/optimizer/internal.h4
3 files changed, 9 insertions, 7 deletions
diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index af8d401aa12..31747b23956 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.80 1999/07/03 00:32:38 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.81 1999/07/07 09:27:25 momjian Exp $
*
*
* INTERFACE ROUTINES
@@ -57,8 +57,10 @@
/*
* macros used in guessing how many tuples are on a page.
*/
-#define AVG_TUPLE_SIZE MinTupleSize
-#define NTUPLES_PER_PAGE(natts) (BLCKSZ/((natts)*AVG_TUPLE_SIZE))
+#define AVG_ATTR_SIZE 8
+#define NTUPLES_PER_PAGE(natts) \
+ ((BLCKSZ - MAXALIGN(sizeof (PageHeaderData))) / \
+ ((natts) * AVG_ATTR_SIZE + MAXALIGN(sizeof(HeapTupleHeaderData))))
/* non-export function prototypes */
static Oid GetHeapRelationOid(char *heapRelationName, char *indexRelationName,
diff --git a/src/backend/optimizer/path/costsize.c b/src/backend/optimizer/path/costsize.c
index c27ae1fd282..05d12e39156 100644
--- a/src/backend/optimizer/path/costsize.c
+++ b/src/backend/optimizer/path/costsize.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/path/costsize.c,v 1.39 1999/07/07 09:11:15 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/path/costsize.c,v 1.40 1999/07/07 09:27:26 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -51,7 +51,7 @@ bool _enable_nestloop_ = true;
bool _enable_mergejoin_ = true;
bool _enable_hashjoin_ = true;
-Cost _cpu_page_weight_ = _CPU_PAGE_WEIGHT_;
+Cost _cpu_page_weight_ = _CPU_PAGE_WEIGHT_;
Cost _cpu_index_page_wight_ = _CPU_INDEX_PAGE_WEIGHT_;
/*
diff --git a/src/include/optimizer/internal.h b/src/include/optimizer/internal.h
index 51e15d2507c..3812d421f9f 100644
--- a/src/include/optimizer/internal.h
+++ b/src/include/optimizer/internal.h
@@ -6,7 +6,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: internal.h,v 1.20 1999/05/25 16:14:18 momjian Exp $
+ * $Id: internal.h,v 1.21 1999/07/07 09:27:28 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -27,7 +27,7 @@
* System-dependent tuning constants
*
*/
-#define _CPU_PAGE_WEIGHT_ 0.033/* CPU-heap-to-page cost weighting factor */
+#define _CPU_PAGE_WEIGHT_ 0.033 /* CPU-heap-to-page cost weighting factor */
#define _CPU_INDEX_PAGE_WEIGHT_ 0.017 /* CPU-index-to-page cost
* weighting factor */
#define _MAX_KEYS_ INDEX_MAX_KEYS /* maximum number of keys in an