Re: problem with from_collapse_limit and joined views

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Am Samstag 04 Dezember 2010 schrieb Tom Lane:
> "Kevin Grittner" <Kevin.Grittner@xxxxxxxxxxxx> writes:
...
> > One option would be to create a different user for running queries
> > which read from complex views such as this.
> 
> If you don't want to change the collapse limits, the only other
> option is to restructure this specific query so that its syntactic
> structure is closer to the ideal join order.  Look at the plan you
> get in the good-performing case and re-order the join syntax to look
> like that.

no that's not working in this case.
view1 and view2 are written with explicit joins and no better join was 
possible. Each view works perfect standalone. 
In my above example i have rewritten view1 without explicit joins only 
for testing purpose. Without explicit joins i can gather the optimal 
query plan from a slightly higher from_collapse_limit (see workaround 2 
from my initial posting). 
If both views using explicit joins the from_collapse_limit is useless 
(only join_collapse_limit usable).

The problem exists only for "view1 JOIN view2" and that pgsql don't 
"see" that an element of view2 contains an index-access for reducing the 
data from view1. Only if he can break the complete join of both views 
into one query-plan he can "see" this. But for this i must raise the 
limits.

Looks like some improvement to the geco optimizer was needed here ;)


regards
msc

-- 
Sent via pgsql-performance mailing list (pgsql-performance@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance


[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux