Improve planning of Materialize nodes inserted atop the inner input of a
authorTom Lane <tgl@sss.pgh.pa.us>
Sun, 15 Nov 2009 02:45:35 +0000 (02:45 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Sun, 15 Nov 2009 02:45:35 +0000 (02:45 +0000)
commitcaf9c830d9d1180ab693f8a6eb205f5862174158
treea9a6d4d79bedc2a62e87cd7eeea1bffa18e1836b
parent29faadcd2780f74550d6a983a81bc6bad3967bd6
Improve planning of Materialize nodes inserted atop the inner input of a
mergejoin to shield it from doing mark/restore and refetches.  Put an explicit
flag in MergePath so we can centralize the logic that knows about this,
and add costing logic that considers using Materialize even when it's not
forced by the previously-existing considerations.  This is in response to
a discussion back in August that suggested that materializing an inner
indexscan can be helpful when the refetch percentage is high enough.
src/backend/nodes/outfuncs.c
src/backend/optimizer/path/allpaths.c
src/backend/optimizer/path/costsize.c
src/backend/optimizer/plan/createplan.c
src/backend/optimizer/util/pathnode.c
src/include/nodes/relation.h
src/include/optimizer/cost.h