]> granicus.if.org Git - postgresql/commit
If a LIMIT is applied to a UNION ALL query, plan each UNION arm as
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 10 Jun 2005 02:21:05 +0000 (02:21 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 10 Jun 2005 02:21:05 +0000 (02:21 +0000)
commit3b167a4099c9ea2e86cd536afb75becd1f3f3875
treecdba797e824f8145bbaf1deb7dbc44f15df5b7a7
parent39cee738895447cb09bcf9be04ab85b97531d951
If a LIMIT is applied to a UNION ALL query, plan each UNION arm as
if the limit were directly applied to it.  This does not actually
add a LIMIT plan node to the generated subqueries --- that would be
useless overhead --- but it does cause the planner to prefer fast-
start plans when the limit is small.  After an idea from Phil Endecott.
src/backend/optimizer/plan/planner.c
src/backend/optimizer/prep/prepunion.c
src/include/optimizer/prep.h