Make some adjustments to reduce platform dependencies in plan selection.
Tom Lane <tgl@sss.pgh.pa.us>
Make some adjustments to reduce platform dependencies in plan selection. In particular, there was a mathematical tie between the two possible nestloop-with-materialized-inner-scan plans for a join (ie, we computed the same cost with either input on the inside), resulting in a roundoff error driven choice, if the relations were both small enough to fit in sort_mem. Add a small cost factor to ensure we prefer materializing the smaller input. This changes several regression test plans, but with any luck we will now have more stability across platforms.
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/optimizer/path/costsize.c | modified | +10 −1 |
| src/backend/optimizer/util/plancat.c | modified | +8 −3 |
| src/test/regress/expected/geometry_1.out | modified | +107 −107 |
| src/test/regress/expected/geometry_2.out | modified | +107 −107 |
| src/test/regress/expected/geometry.out | modified | +107 −107 |
| src/test/regress/expected/inherit.out | modified | +8 −7 |
| src/test/regress/expected/join.out | modified | +1140 −1140 |
| src/test/regress/sql/inherit.sql | modified | +2 −1 |
| src/test/regress/sql/join.sql | modified | +4 −4 |