Re: [HACKERS] 8.4, One-Time Filter and subquery ( ... FROM function() union all ... )

2009-07-07 Thread Sergey Burladyan
Tom Lane t...@sss.pgh.pa.us writes: As of CVS HEAD you get QUERY PLAN Result (cost=0.00..0.01 rows=1 width=0) (actual

Re: [HACKERS] 8.4, One-Time Filter and subquery ( ... FROM function() union all ... )

2009-07-07 Thread Mark Mielke
I found Tom's response ambiguous - but positive in either way, so it gave me a smile. :-) Which of the following two great things occurred? 1) Tom popped a quick fix on CVS HEAD? (Pretty fast!) 2) Tom or somebody else had already done it? Cheers, mark On 07/07/2009 05:14 PM, Sergey

Re: [HACKERS] 8.4, One-Time Filter and subquery ( ... FROM function() union all ... )

2009-07-07 Thread Tom Lane
Mark Mielke m...@mark.mielke.cc writes: Which of the following two great things occurred? 1) Tom popped a quick fix on CVS HEAD? (Pretty fast!) 2) Tom or somebody else had already done it? http://archives.postgresql.org/pgsql-committers/2009-07/msg00067.php

Re: [HACKERS] 8.4, One-Time Filter and subquery ( ... FROM function() union all ... )

2009-07-07 Thread Sergey Burladyan
Oh, now problem with simple query: 8.4.0 from Debian explain analyze select i from t where i = 10 and i = 1; QUERY PLAN Result (cost=0.00..0.01 rows=1 width=0) (actual

Re: [HACKERS] 8.4, One-Time Filter and subquery ( ... FROM function() union all ... )

2009-07-07 Thread Tom Lane
Sergey Burladyan eshkin...@gmail.com writes: Oh, now problem with simple query: 8.4.0 from Debian explain analyze select i from t where i = 10 and i = 1; QUERY PLAN

Re: [HACKERS] 8.4, One-Time Filter and subquery ( ... FROM function() union all ... )

2009-07-07 Thread Sergey Burladyan
Tom Lane t...@sss.pgh.pa.us writes: Sergey Burladyan eshkin...@gmail.com writes: Oh, now problem with simple query: 8.4.0 from Debian explain analyze select i from t where i = 10 and i = 1; QUERY PLAN

Re: [HACKERS] 8.4, One-Time Filter and subquery ( ... FROM function() union all ... )

2009-07-06 Thread Tom Lane
Sergey Burladyan eshkin...@gmail.com writes: 8.4 always execute functions in this subquery, even if result do not need it. 8.3 correctly optimize this and do not execute this functions, here is example: create function foo() returns int language sql as $$ select pg_sleep(5); select 1 $$;

Re: [HACKERS] 8.4, One-Time Filter and subquery ( ... FROM function() union all ... )

2009-07-06 Thread Tom Lane
Sergey Burladyan eshkin...@gmail.com writes: PostgreSQL 8.4.0 on i486-pc-linux-gnu, compiled by GCC gcc-4.3.real (Debian 4.3.3-13) 4.3.3, 32-bit EXPLAIN ANALYZE select * from (select 1 as i, r from foo() r union all select 2, r from foo() r) as x where i = 3;

[HACKERS] 8.4, One-Time Filter and subquery ( ... FROM function() union all ... )

2009-07-05 Thread Sergey Burladyan
I am testing some of my queries with 8.4 and find some performance decline. 8.4 always execute functions in this subquery, even if result do not need it. 8.3 correctly optimize this and do not execute this functions, here is example: create function foo() returns int language sql as $$ select

Re: [HACKERS] 8.4, One-Time Filter and subquery ( ... FROM function() union all ... )

2009-07-05 Thread Sergey Burladyan
Sergey Burladyan eshkin...@gmail.com writes: Thinks ! Th_a_nks ! :) -- Sergey Burladyan -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers