summaryrefslogtreecommitdiff
path: root/src/backend/optimizer/util/plancat.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/optimizer/util/plancat.c')
-rw-r--r--src/backend/optimizer/util/plancat.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/backend/optimizer/util/plancat.c b/src/backend/optimizer/util/plancat.c
index b4f42ac1235..9c9f586727a 100644
--- a/src/backend/optimizer/util/plancat.c
+++ b/src/backend/optimizer/util/plancat.c
@@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/optimizer/util/plancat.c,v 1.98 2004/12/01 19:00:43 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/optimizer/util/plancat.c,v 1.99 2004/12/02 01:34:17 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -268,6 +268,12 @@ estimate_rel_size(Relation rel, int32 *attr_widths,
* but is probably an overestimate for indexes. Fortunately
* get_relation_info() can clamp the overestimate to the
* parent table's size.
+ *
+ * Note: this code intentionally disregards alignment
+ * considerations, because (a) that would be gilding the
+ * lily considering how crude the estimate is, and (b)
+ * it creates platform dependencies in the default plans
+ * which are kind of a headache for regression testing.
*/
int32 tuple_width = 0;
int i;
@@ -291,8 +297,7 @@ estimate_rel_size(Relation rel, int32 *attr_widths,
attr_widths[i] = item_width;
tuple_width += item_width;
}
- tuple_width = MAXALIGN(tuple_width);
- tuple_width += MAXALIGN(sizeof(HeapTupleHeaderData));
+ tuple_width += sizeof(HeapTupleHeaderData);
tuple_width += sizeof(ItemPointerData);
/* note: integer division is intentional here */
density = (BLCKSZ - sizeof(PageHeaderData)) / tuple_width;