pgsql: If a LIMIT is applied to a UNION ALL query, plan each UNION arm - Mailing list pgsql-committers

From tgl@svr1.postgresql.org (Tom Lane)
Subject pgsql: If a LIMIT is applied to a UNION ALL query, plan each UNION arm
Date
Msg-id 20050610022106.338C752969@svr1.postgresql.org
Whole thread Raw
List 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)

pgsql-committers by date:

Previous
From: tgl@svr1.postgresql.org (Tom Lane)
Date:
Subject: pgsql: Revise searching of subplan target lists to use something more
Next
From: momjian@svr1.postgresql.org (Bruce Momjian)
Date:
Subject: pgsql: Add the "PGPASSFILE" environment variable to specify to the