diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2015-01-18 17:04:11 -0500 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2015-01-18 17:04:11 -0500 |
commit | 75df6dc083f7a989697b5002a421fb204f2eeddb (patch) | |
tree | 90c304618b3eb5590e5c27adc2a09058dca69e6c | |
parent | 4c34dcf97f70fa5c3d5fbf70caff12032a27a7dd (diff) | |
download | postgresql-75df6dc083f7a989697b5002a421fb204f2eeddb.tar.gz postgresql-75df6dc083f7a989697b5002a421fb204f2eeddb.zip |
Fix ancient thinko in default table rowcount estimation.
The code used sizeof(ItemPointerData) where sizeof(ItemIdData) is correct,
since we're trying to account for a tuple's line pointer. Spotted by
Tomonari Katsumata (bug #12584).
Although this mistake is of very long standing, no back-patch, since it's
a relatively harmless error and changing it would risk changing default
planner behavior in stable branches. (I don't see any change in regression
test outputs here, but the buildfarm may think differently.)
-rw-r--r-- | src/backend/optimizer/util/plancat.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/backend/optimizer/util/plancat.c b/src/backend/optimizer/util/plancat.c index 265c865fcb8..fb7db6d9599 100644 --- a/src/backend/optimizer/util/plancat.c +++ b/src/backend/optimizer/util/plancat.c @@ -509,7 +509,7 @@ estimate_rel_size(Relation rel, int32 *attr_widths, tuple_width = get_rel_data_width(rel, attr_widths); tuple_width += sizeof(HeapTupleHeaderData); - tuple_width += sizeof(ItemPointerData); + tuple_width += sizeof(ItemIdData); /* note: integer division is intentional here */ density = (BLCKSZ - SizeOfPageHeaderData) / tuple_width; } |