pgsql: If a LIMIT is applied to a UNION ALL query, plan each UNION arm

From: tgl(at)svr1(dot)postgresql(dot)org (Tom Lane)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: If a LIMIT is applied to a UNION ALL query, plan each UNION arm
Date: 2005-06-10 02:21:06
Message-ID: 20050610022106.338C752969@svr1.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Log Message:
-----------
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.

Modified Files:
--------------
pgsql/src/backend/optimizer/plan:
planner.c (r1.188 -> r1.189)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/plan/planner.c.diff?r1=1.188&r2=1.189)
pgsql/src/backend/optimizer/prep:
prepunion.c (r1.123 -> r1.124)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/prep/prepunion.c.diff?r1=1.123&r2=1.124)
pgsql/src/include/optimizer:
prep.h (r1.50 -> r1.51)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/optimizer/prep.h.diff?r1=1.50&r2=1.51)

Browse pgsql-committers by date

  From Date Subject
Next Message Bruce Momjian 2005-06-10 03:02:51 pgsql: Add the "PGPASSFILE" environment variable to specify to the
Previous Message Tom Lane 2005-06-10 00:28:54 pgsql: Revise searching of subplan target lists to use something more