Re: [PERFORM] LIMIT and UNION ALL

2011-05-26 Thread Tom Lane
Dave Johansen writes: > ... So is there a way to make the > planner perform the same sort of operation and push those same constraints > into the sub-queries on its own? No. As was mentioned upthread, there is a solution for this in 9.1, although it doesn't work in exactly the way you suggest.

Re: [PERFORM] LIMIT and UNION ALL

2011-05-26 Thread Dave Johansen
On Wed, May 18, 2011 at 8:54 AM, Robert Klemme wrote: > On Wed, May 18, 2011 at 5:26 PM, Dave Johansen > wrote: > > I am using Postgres 8.3.3 and I have a VIEW which is a UNION ALL of two > > tables but when I do a select on the view using a LIMIT, it scans the > entire > > tables and takes signi

Re: [PERFORM] LIMIT and UNION ALL

2011-05-18 Thread Pavel Stehule
Hello 2011/5/18 Dave Johansen : > I am using Postgres 8.3.3 and I have a VIEW which is a UNION ALL of two > tables but when I do a select on the view using a LIMIT, it scans the entire > tables and takes significantly longer than writing out the query with the > LIMITs in the sub-queries themselv

Re: [PERFORM] LIMIT and UNION ALL

2011-05-18 Thread Robert Klemme
On Wed, May 18, 2011 at 5:26 PM, Dave Johansen wrote: > I am using Postgres 8.3.3 and I have a VIEW which is a UNION ALL of two > tables but when I do a select on the view using a LIMIT, it scans the entire > tables and takes significantly longer than writing out the query with the > LIMITs in the

[PERFORM] LIMIT and UNION ALL

2011-05-18 Thread Dave Johansen
I am using Postgres 8.3.3 and I have a VIEW which is a UNION ALL of two tables but when I do a select on the view using a LIMIT, it scans the entire tables and takes significantly longer than writing out the query with the LIMITs in the sub-queries themselves. Is there a solution to get the view to