Re: Pushing IN (subquery) down through UNION ALL?

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Thom Brown <thom(at)linux(dot)com>
Cc: Dave Johansen <davejohansen(at)gmail(dot)com>, pgsql-performance(at)postgresql(dot)org
Subject: Re: Pushing IN (subquery) down through UNION ALL?
Date: 2011-03-02 14:22:39
Message-ID: AANLkTinyB4NCDrH8sY8n+EJKSU9=_HtMLFL6bxZCia9W@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Wed, Mar 2, 2011 at 9:11 AM, Thom Brown <thom(at)linux(dot)com> wrote:
> On 2 March 2011 19:38, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
>> On Thu, Feb 24, 2011 at 11:38 AM, Dave Johansen <davejohansen(at)gmail(dot)com> wrote:
>>> I also just noticed that an ORDER BY x LIMIT n optimization is not pushed
>>> down through the UNION ALL as well. I understand that this may be a little
>>> trickier because the ORDER BY and LIMIT would need to be applied to the
>>> subqueries and then re-applied after the APPEND,
>>
>> PostgreSQL 9.1 will know how to do this, FWIW.
>
> Out of curiosity, what was the commit for this?

11cad29c91524aac1d0b61e0ea0357398ab79bf8 Support MergeAppend plans, to
allow sorted output from append relations.
034967bdcbb0c7be61d0500955226e1234ec5f04 Reimplement planner's
handling of MIN/MAX aggregate optimization.
947d0c862c895618a874344322e7b07c9df05cb2 Use appendrel planning logic
for top-level UNION ALL structures.
6fbc323c8042303a737028f9da7616896bccc517 Further fallout from the
MergeAppend patch.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Thom Brown 2011-03-02 14:23:49 Re: Pushing IN (subquery) down through UNION ALL?
Previous Message Thom Brown 2011-03-02 14:11:51 Re: Pushing IN (subquery) down through UNION ALL?