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

Re: WHERE condition not being pushed down to union parts

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "John L(dot) Clark" <jlc6(at)po(dot)cwru(dot)edu>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: WHERE condition not being pushed down to union parts
Date: 2009-04-21 14:35:34
Message-ID: 1929.1240324534@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-performance
"John L. Clark" <jlc6(at)po(dot)cwru(dot)edu> writes:
> I have a database with two tables that relate similar data, and a view
> which projects and combines the data from these two tables in order to
> access them both in a consistent manner.  With enough information, the
> application can specifically choose to query from one table or the
> other, but in the more general case the data could come from either
> table, so I need to query the view.  When I join against the view (or
> an equivalent subselect), however, it looks like the joining condition
> is not pushed down into the individual components of the union that
> defines the view.

You never mentioned what PG version you are using, but I'm betting
it's 8.1.x.  This should work the way you are expecting in 8.2 and up.

			regards, tom lane

In response to

Responses

pgsql-performance by date

Next:From: John L. ClarkDate: 2009-04-21 14:41:09
Subject: Re: WHERE condition not being pushed down to union parts
Previous:From: John L. ClarkDate: 2009-04-21 14:21:34
Subject: WHERE condition not being pushed down to union parts

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