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: 3577.1030634699@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
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

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2002-08-29 15:37:39 Re: Visibility regression test
Previous Message Manfred Koizar 2002-08-29 15:06:58 Re: Visibility regression test