Re: [HACKERS] performance regression in 9.2 CTE with SRF function

2013-02-11 Thread Pavel Stehule
2013/2/11 Tom Lane : > Pavel Stehule writes: >>> no, there is strange estimation >>> >>> SubPlan 2 >>> -> CTE Scan on pl pl_1 (cost=0.00..468.59 >>> rows=89000 width=4) (actual time=0.023..8.379 rows=566 loops=1000) >>> Output: foo(pl_1.a) > > Nothing strange about it. 89 rows out from the unde

Re: [HACKERS] performance regression in 9.2 CTE with SRF function

2013-02-11 Thread Tom Lane
Pavel Stehule writes: >> no, there is strange estimation >> >> SubPlan 2 >> -> CTE Scan on pl pl_1 (cost=0.00..468.59 >> rows=89000 width=4) (actual time=0.023..8.379 rows=566 loops=1000) >> Output: foo(pl_1.a) Nothing strange about it. 89 rows out from the underlying CTE (which appears to be

Re: [HACKERS] performance regression in 9.2 CTE with SRF function

2013-02-10 Thread Pavel Stehule
> > no, there is strange estimation > > -> Seq Scan on public.x2 (cost=0.00..345560.00 rows=500 > width=4) (actual time=17.914..9330.645 rows=133 loops=1) >Output: x2.a >Filter: (NOT (SubPlan 2)) >Rows Removed by Filter: 867 >

Re: [HACKERS] performance regression in 9.2 CTE with SRF function

2013-02-10 Thread Pavel Stehule
2013/2/11 Tom Lane : > Pavel Stehule writes: >> In Czech discussion group was reported performance regression of CTE >> query. I wrote a test, when I can show it. > > I don't see anything tremendously wrong here. The older branches are > choosing the right plan for entirely wrong reasons: they do

Re: [HACKERS] performance regression in 9.2 CTE with SRF function

2013-02-10 Thread Tom Lane
Pavel Stehule writes: > In Czech discussion group was reported performance regression of CTE > query. I wrote a test, when I can show it. I don't see anything tremendously wrong here. The older branches are choosing the right plan for entirely wrong reasons: they don't notice that "select foo(a)

[HACKERS] performance regression in 9.2 CTE with SRF function

2013-02-09 Thread Pavel Stehule
Hello In Czech discussion group was reported performance regression of CTE query. I wrote a test, when I can show it. Execution on 9.2, 9.3 is about 9 sec, on 8.4, 9.1 is about 30ms with default work_mem ='1MB' optimal plan (8.4) QUERY PLAN