Fix mergejoin cost estimation so that we consider the statistical ranges of
the two join variables at both ends: not only trailing rows that need not be scanned because there cannot be a match on the other side, but initial rows that will be scanned without possibly having a match. This allows a more realistic estimate of startup cost to be made, per recent pgsql-performance discussion. In passing, fix a couple of bugs that had crept into mergejoinscansel: it was not quite up to speed for the task of estimating descending-order scans, which is a new requirement in 8.3.
Showing
- src/backend/optimizer/path/costsize.c 78 additions, 31 deletionssrc/backend/optimizer/path/costsize.c
- src/backend/utils/adt/selfuncs.c 259 additions, 111 deletionssrc/backend/utils/adt/selfuncs.c
- src/include/nodes/relation.h 5 additions, 3 deletionssrc/include/nodes/relation.h
- src/include/utils/selfuncs.h 3 additions, 3 deletionssrc/include/utils/selfuncs.h
Loading
Please register or sign in to comment