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

From: Thom Brown <thom(at)linux(dot)com>
To: Robert Haas <robertmhaas(at)gmail(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:23:49
Message-ID: AANLkTikp_ThWC8K3Lt6BBZ4ZvvqXcp6=X9Rwo0D76g3m@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On 2 March 2011 19:52, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> 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.

Erk.. I see. Thanks :)

--
Thom Brown
Twitter: @darkixion
IRC (freenode): dark_ixion
Registered Linux user: #516935

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Robert Haas 2011-03-02 15:29:21 Re: Anyone tried Flashcache with PostgreSQL?
Previous Message Robert Haas 2011-03-02 14:22:39 Re: Pushing IN (subquery) down through UNION ALL?