Re: UNION ALL with WHERE clause does not use Merge Append - Mailing list pgsql-hackers

From Tom Lane
Subject Re: UNION ALL with WHERE clause does not use Merge Append
Date
Msg-id 12520.1345129152@sss.pgh.pa.us
Whole thread Raw
In response to UNION ALL with WHERE clause does not use Merge Append  (Marti Raudsepp <marti@juffo.org>)
List pgsql-hackers
Marti Raudsepp <marti@juffo.org> writes:
> Is this just a planner shortcoming or a bug? Or is there some
> justification for this behavior?

Per the comment in is_safe_append_member():
    * It's only safe to pull up the child if its jointree contains exactly    * one RTE, else the AppendRelInfo data
structurebreaks. The one base RTE    * could be buried in several levels of FromExpr, however.    *    * Also, the
childcan't have any WHERE quals because there's no place to    * put them in an appendrel.  (This is a bit
annoying...)

This will probably get fixed someday, but I wouldn't recommend holding
your breath for it.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: cataloguing NOT NULL constraints
Next
From: Alvaro Herrera
Date:
Subject: Re: [COMMITTERS] pgsql: Clean up the #include mess a little.