]> granicus.if.org Git - postgresql/commit
Fix cost estimates for EXISTS subqueries that are evaluated as initPlans
authorTom Lane <tgl@sss.pgh.pa.us>
Sat, 22 Sep 2007 21:36:40 +0000 (21:36 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Sat, 22 Sep 2007 21:36:40 +0000 (21:36 +0000)
commit71256875114c8c51ac9f36841943ab654f50b646
tree3ec457b595953e5e485130df2020166ea64f0077
parent576b8903f75285467f40fba7bed5fab0667d39ba
Fix cost estimates for EXISTS subqueries that are evaluated as initPlans
(because they are uncorrelated with the immediate parent query).  We were
charging the full run cost to the parent node, disregarding the fact that
only one row need be fetched for EXISTS.  While this would only be a
cosmetic issue in most cases, it might possibly affect planning outcomes
if the parent query were itself a subquery to some upper query.
Per recent discussion with Steve Crawford.
src/backend/optimizer/path/costsize.c
src/backend/optimizer/plan/subselect.c
src/include/optimizer/cost.h