Skip site navigation (1) Skip section navigation (2)

Re: Proposed patch for qual pushdown into UNION/INTERSECT

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
Cc: pgsql-patches(at)postgreSQL(dot)org
Subject: Re: Proposed patch for qual pushdown into UNION/INTERSECT
Date: 2002-08-29 15:24:59
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-patches
Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com> writes:
> I do wonder if queries like
> select * from ((select * from bar1 union all select * from bar2
> union all (select * from bar1 except select * from bar2)) intersect select
> * from bar1) as foo where a>4;

> can push the a>4 restriction into the right side of the intersect which it
> doesn't seem to right now,

Not without a lot more work, which I haven't got time for now.

> We could probably do:
> Subquery
>  Intersect
>   Append
>    Subquery (passing down a>4)
>    Subquery (passing down a>4)
>    <something> (filter a>4)
>     Except
>      Subquery
>      Subquery
>   Subquery (passing down a>4)
> and get the same effect,

Yeah, the problem is the planner doesn't currently cope with attaching
quals to intermediate levels of a set-op tree, so there's no way to
do the above.

> but I think
> the mixed case is probably rare enough
> to not worry about for now.

Agreed.  This is still a step forward.

			regards, tom lane

In response to

pgsql-patches by date

Next:From: Tom LaneDate: 2002-08-29 15:37:39
Subject: Re: Visibility regression test
Previous:From: Manfred KoizarDate: 2002-08-29 15:06:58
Subject: Re: Visibility regression test

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group